From 69fd48bca49f1af2e097ee174929c6fbb087efae Mon Sep 17 00:00:00 2001 From: T <74899888+tslashd@users.noreply.github.com> Date: Sat, 23 Dec 2023 12:23:11 +0200 Subject: [PATCH] don't forget to clear dictionaries --- src/ST-Events/TriggerStartTouch.cs | 6 ++++++ src/ST-Player/PlayerStats.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ST-Events/TriggerStartTouch.cs b/src/ST-Events/TriggerStartTouch.cs index 2fd2654..631a704 100644 --- a/src/ST-Events/TriggerStartTouch.cs +++ b/src/ST-Events/TriggerStartTouch.cs @@ -135,6 +135,12 @@ at System.Delegate.DynamicInvokeImpl(Object[] args) int stage = Int32.Parse(Regex.Match(trigger.Entity.Name, "[0-9][0-9]?").Value) - 1; player.Timer.Stage = stage; + #if DEBUG + Console.WriteLine($"CS2 Surf DEBUG >> CBaseTrigger_StartTouchFunc (Stage start zones) -> player.Timer.IsRunning: {player.Timer.IsRunning}"); + Console.WriteLine($"CS2 Surf DEBUG >> CBaseTrigger_StartTouchFunc (Stage start zones) -> !player.Timer.IsStageMode: {!player.Timer.IsStageMode}"); + Console.WriteLine($"CS2 Surf DEBUG >> CBaseTrigger_StartTouchFunc (Stage start zones) -> player.Stats.ThisRun.Checkpoint.Count <= stage: {player.Stats.ThisRun.Checkpoint.Count <= stage}"); + #endif + // To-do:* checkpoint functionality because stages = checkpoints when in a run on a Staged map // To-do:* This triggers more than once at random :monkaHmm: *already posted in CS# about OnPlayerConnect being triggered after OnStartTouch* // This should patch up re-triggering *player.Stats.ThisRun.Checkpoint.Count < stage* diff --git a/src/ST-Player/PlayerStats.cs b/src/ST-Player/PlayerStats.cs index f367c64..5a7dbd5 100644 --- a/src/ST-Player/PlayerStats.cs +++ b/src/ST-Player/PlayerStats.cs @@ -234,6 +234,7 @@ public void SaveCurrentRunCheckpoints(Player player, TimerDatabase DB) newPbTask.Dispose(); } } + player.Stats.ThisRun.Checkpoint.Clear(); } public void SaveMapTime(Player player, TimerDatabase DB, int mapId) @@ -308,5 +309,4 @@ public void LoadMapTimesData(int playerId, int mapId, TimerDatabase DB) } playerStats.Close(); } - } \ No newline at end of file