From 3ffcac3f1f46d696056b665e0f485b0d6f7da53c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 2 Aug 2017 00:26:56 -0400 Subject: fix Context.IsPlayerFree being false when player can't move (#330) For example, the value was false when the player used a tool which wasn't intended. --- src/StardewModdingAPI/Context.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/StardewModdingAPI/Context.cs') diff --git a/src/StardewModdingAPI/Context.cs b/src/StardewModdingAPI/Context.cs index 6c5ae40e..119e14c8 100644 --- a/src/StardewModdingAPI/Context.cs +++ b/src/StardewModdingAPI/Context.cs @@ -16,8 +16,11 @@ namespace StardewModdingAPI /// Whether the player has loaded a save and the world has finished initialising. public static bool IsWorldReady { get; internal set; } - /// Whether the player is free to move around (e.g. save is loaded, no menu is displayed, no cutscene is in progress, etc). - public static bool IsPlayerFree => Context.IsWorldReady && Game1.activeClickableMenu == null && Game1.player.CanMove && !Game1.dialogueUp && !Game1.eventUp; + /// Whether is true and the player is free to act in the world (no menu is displayed, no cutscene is in progress, etc). + public static bool IsPlayerFree => Context.IsWorldReady && Game1.activeClickableMenu == null && !Game1.dialogueUp && !Game1.eventUp; + + /// Whether is true and the player is free to move (e.g. not using a tool). + public static bool CanPlayerMove => Context.IsPlayerFree && Game1.player.CanMove; /// Whether the game is currently running the draw loop. This isn't relevant to most mods, since you should use to draw to the screen. public static bool IsInDrawLoop { get; internal set; } -- cgit