fix error when mod edits bundle data while a split-screen player is joining

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

View File

@ -20,6 +20,7 @@
* 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.
* Fixed error when editing bundle data while a split-screen player is joining.
## 3.9.5
Released 21 March 2021 for Stardew Valley 1.5.4 or later.

View File

@ -274,6 +274,7 @@ namespace StardewModdingAPI.Metadata
return true;
case "data\\bundles": // NetWorldState constructor
if (Context.IsMainPlayer && Game1.netWorldState != null)
{
var bundles = this.Reflection.GetField<NetBundles>(Game1.netWorldState.Value, "bundles").GetValue();
var rewards = this.Reflection.GetField<NetIntDictionary<bool, NetBool>>(Game1.netWorldState.Value, "bundleRewards").GetValue();