summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-10-28 19:31:12 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-10-28 19:31:12 -0400
commit2872cad9fea48a5435bcac2f4803af96133eb6b9 (patch)
tree88c9c3eb0fe9cbeed5235de8c0e7bf8d5875d355
parentb831e36c5b6e8bc661f203b5ed8c251deed833bc (diff)
downloadSMAPI-2872cad9fea48a5435bcac2f4803af96133eb6b9.tar.gz
SMAPI-2872cad9fea48a5435bcac2f4803af96133eb6b9.tar.bz2
SMAPI-2872cad9fea48a5435bcac2f4803af96133eb6b9.zip
fix Context.IsPlayerFree being true before player finishes transitioning to a new location in multiplayer
-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 acbaef99..cb83e7ec 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -42,6 +42,7 @@
* Fixed `IContentPack.ReadJsonFile` allowing non-relative paths.
* Fixed trace logs not showing path for invalid mods.
* Fixed 'no update keys' warning not shown for mods with only invalid update keys.
+ * Fixed `Context.IsPlayerFree` being true before the player finishes transitioning to a new location in multiplayer.
* Suppressed the game's 'added crickets' debug output.
* **Breaking change:** `helper.ModRegistry` now returns `IModInfo` instead of `IManifest` directly. This lets SMAPI return more metadata about mods.
* **Breaking change:** most SMAPI files have been moved into a `smapi-internal` subfolder. This won't affect compiled mod releases, but you'll need to update the build config NuGet package.
diff --git a/src/SMAPI/Context.cs b/src/SMAPI/Context.cs
index 3905699e..c7aed81d 100644
--- a/src/SMAPI/Context.cs
+++ b/src/SMAPI/Context.cs
@@ -17,7 +17,7 @@ namespace StardewModdingAPI
public static bool IsWorldReady { get; internal set; }
/// <summary>Whether <see cref="IsWorldReady"/> is true and the player is free to act in the world (no menu is displayed, no cutscene is in progress, etc).</summary>
- public static bool IsPlayerFree => Context.IsWorldReady && Game1.activeClickableMenu == null && !Game1.dialogueUp && (!Game1.eventUp || Game1.isFestival());
+ public static bool IsPlayerFree => Context.IsWorldReady && Game1.currentLocation != null && Game1.activeClickableMenu == null && !Game1.dialogueUp && (!Game1.eventUp || Game1.isFestival());
/// <summary>Whether <see cref="IsPlayerFree"/> is true and the player is free to move (e.g. not using a tool).</summary>
public static bool CanPlayerMove => Context.IsPlayerFree && Game1.player.CanMove;