From 65b9b195ca0ec1f22525840f21fad2c35868851c Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 15 Jan 2024 23:43:27 +0100 Subject: [PATCH] Fix wrong logic on updating last local gamestate --- CS2GSI/CS2GSI.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CS2GSI/CS2GSI.cs b/CS2GSI/CS2GSI.cs index 42af528..7b2a8db 100644 --- a/CS2GSI/CS2GSI.cs +++ b/CS2GSI/CS2GSI.cs @@ -37,8 +37,6 @@ public class CS2GSI JObject jsonObject = JObject.Parse(messageJson); CS2GameState newState = CS2GameState.ParseFromJObject(jsonObject); this.logger?.Log(LogLevel.Debug, $"Received State:\n{newState.ToString()}"); - this._lastLocalGameState = newState.UpdateGameStateForLocal(_lastLocalGameState); - this.logger?.Log(LogLevel.Debug, $"Updated Local State:\n{_lastLocalGameState.ToString()}"); if (_lastLocalGameState is not null && _allGameStates.Count > 0) { @@ -48,6 +46,8 @@ public class CS2GSI this.logger?.Log(LogLevel.Debug, $"Events:\n\t{string.Join("\n\t", generatedEvents)}"); InvokeEvents(generatedEvents); } + this._lastLocalGameState = newState.UpdateGameStateForLocal(_lastLocalGameState); + this.logger?.Log(LogLevel.Debug, $"Updated Local State:\n{_lastLocalGameState.ToString()}"); _allGameStates.Add(newState); }