fix Context.IsMainPlayer incorrectly true when split-screen player is joining

This commit is contained in:
Jesse Plamondon-Willard 2021-04-04 12:09:07 -04:00
parent 2b1b3b19a5
commit c7db35818b
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@
* For modders: * For modders:
* Added asset propagation for `Data\Concessions`. * Added asset propagation for `Data\Concessions`.
* Improved error-handling during asset propagation. * 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 ## 3.9.5
Released 21 March 2021 for Stardew Valley 1.5.4 or later. Released 21 March 2021 for Stardew Valley 1.5.4 or later.

View File

@ -86,7 +86,7 @@ namespace StardewModdingAPI
public static bool HasRemotePlayers => Context.IsMultiplayer && !Game1.hasLocalClientsOnly; 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> /// <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);
/********* /*********