From c3ba3a135f252a0f844b3b7541e5845b3ca885aa Mon Sep 17 00:00:00 2001 From: 1zc Date: Sun, 10 Mar 2024 19:12:04 +1100 Subject: [PATCH] Handle starting and saving bonus replays --- src/ST-Events/TriggerStartTouch.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ST-Events/TriggerStartTouch.cs b/src/ST-Events/TriggerStartTouch.cs index 3008028..d9837c9 100644 --- a/src/ST-Events/TriggerStartTouch.cs +++ b/src/ST-Events/TriggerStartTouch.cs @@ -230,6 +230,8 @@ internal HookResult OnTriggerStartTouch(CEntityIOOutput output, string name, CEn // We only want this working if they're in bonus mode, ignore otherwise. if (player.Timer.IsBonusMode) { + player.ReplayRecorder.Start(); // Start replay recording + player.Timer.Reset(); player.Timer.IsBonusMode = true; int bonus = Int32.Parse(Regex.Match(trigger.Entity.Name, "[0-9][0-9]?").Value); @@ -259,7 +261,9 @@ internal HookResult OnTriggerStartTouch(CEntityIOOutput output, string name, CEn } player.Timer.Stop(); - // To-do: bonus replays + player.ReplayRecorder.CurrentSituation = ReplayFrameSituation.END_RUN; + + // To-do: Bonus prespeeds string PracticeString = ""; if (player.Timer.IsPracticeMode) @@ -284,8 +288,8 @@ internal HookResult OnTriggerStartTouch(CEntityIOOutput output, string name, CEn throw new Exception("CS2 Surf ERROR >> OnTriggerStartTouch (Bonus end zone) -> DB object is null, this shouldn't happen."); player.Stats.BonusPB[bonus][style].Ticks = player.Timer.Ticks; // Reload the run_time for the HUD and also assign for the DB query + // To-do: save to DB - if (!player.Timer.IsPracticeMode) { AddTimer(1.5f, () => {