summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-04-04 12:09:07 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-04-04 12:09:07 -0400
commitc7db35818b93ea4735c2b69ce28cd0a24e603d14 (patch)
tree819d208ac860f148e61f7b2885229e03bea8287e
parent2b1b3b19a507876e106a444c93b4c33aca35c353 (diff)
downloadSMAPI-c7db35818b93ea4735c2b69ce28cd0a24e603d14.tar.gz
SMAPI-c7db35818b93ea4735c2b69ce28cd0a24e603d14.tar.bz2
SMAPI-c7db35818b93ea4735c2b69ce28cd0a24e603d14.zip
fix Context.IsMainPlayer incorrectly true when split-screen player is joining
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI/Context.cs2
2 files changed, 2 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 77c3bfbe..8e749490 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -19,6 +19,7 @@
* For modders:
* Added asset propagation for `Data\Concessions`.
* Improved error-handling during asset propagation.
+ * Fixed `Context.IsMainPlayer` returning true for a farmhand in split-screen mode before the screen is initialized.
## 3.9.5
Released 21 March 2021 for Stardew Valley 1.5.4 or later.
diff --git a/src/SMAPI/Context.cs b/src/SMAPI/Context.cs
index 5f70d0f7..a745592c 100644
--- a/src/SMAPI/Context.cs
+++ b/src/SMAPI/Context.cs
@@ -86,7 +86,7 @@ namespace StardewModdingAPI
public static bool HasRemotePlayers => Context.IsMultiplayer && !Game1.hasLocalClientsOnly;
/// <summary>Whether the current player is the main player. This is always true in single-player, and true when hosting in multiplayer.</summary>
- public static bool IsMainPlayer => Game1.IsMasterGame && !(TitleMenu.subMenu is FarmhandMenu);
+ public static bool IsMainPlayer => Game1.IsMasterGame && Context.ScreenId == 0 && !(TitleMenu.subMenu is FarmhandMenu);
/*********