From 398c7d66cb707f475b239c9ba5b06154fd518b49 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 8 Sep 2020 00:10:24 -0400 Subject: fix input handling issues in SMAPI 3.7 This commit reverses one of the input handling changes in 3.7 to fix... * input being handled twice in some cases (e.g. a left-click to drop a shop item with Better Shop Menu would instantly sell it); * an issue where Harvest With Scythe would cause the player to skid forward more than usual when scything crops; * possibly other reported issues including gamepad input lag. --- src/SMAPI/Framework/Input/SInputState.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/SMAPI/Framework/Input') diff --git a/src/SMAPI/Framework/Input/SInputState.cs b/src/SMAPI/Framework/Input/SInputState.cs index 3dfeb152..f618608a 100644 --- a/src/SMAPI/Framework/Input/SInputState.cs +++ b/src/SMAPI/Framework/Input/SInputState.cs @@ -29,9 +29,6 @@ namespace StardewModdingAPI.Framework.Input /// Whether there are new overrides in or that haven't been applied to the previous state. private bool HasNewOverrides; - /// The game tick when the input state was last updated. - private uint? LastUpdateTick; - /********* ** Accessors @@ -55,14 +52,13 @@ namespace StardewModdingAPI.Framework.Input /********* ** Public methods *********/ - /// Update the current button states for the given tick. This does nothing if the input has already been updated for this tick (e.g. because SMAPI updated it before the game update). - public override void Update() - { - // skip if already updated - if (this.LastUpdateTick == SCore.TicksElapsed) - return; - this.LastUpdateTick = SCore.TicksElapsed; + /// This method is called by the game, and does nothing since SMAPI will already have updated by that point. + [Obsolete("This method should only be called by the game itself.")] + public override void Update() { } + /// Update the current button states for the given tick. + public void TrueUpdate() + { // update base state base.Update(); -- cgit