diff --git a/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc b/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc index a6f5e355ac..cbf06402de 100644 --- a/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc +++ b/goal_src/jak3/levels/wascity/wasstadium/wasstadb-obs.gc @@ -742,6 +742,15 @@ (define *arena-trainer-checkpoint-tokens* (new 'static 'array uint64 2 #xffffffffffffffff #x0)) +;; og:preserve-this helper to reset these globals in between speedruns, otherwise new game can skip straight past tokens +(defun reset-arena-trainer-globals () + (set! *arena-trainer-checkpoint-valid* (the-as object #f)) + (set! *arena-trainer-checkpoint-time* 0.0) + (set! (-> *arena-trainer-checkpoint-tokens* 0) #xffffffffffffffff) + (set! (-> *arena-trainer-checkpoint-tokens* 1) #x0) + (none) + ) + (deftype task-manager-arena-training (task-manager) ((judge-h handle) (arrow-h handle) diff --git a/goal_src/jak3/pc/features/speedruns.gc b/goal_src/jak3/pc/features/speedruns.gc index 62c10f63cb..8be2eb0824 100644 --- a/goal_src/jak3/pc/features/speedruns.gc +++ b/goal_src/jak3/pc/features/speedruns.gc @@ -142,6 +142,7 @@ lighteco darkeco)) +(define-extern reset-arena-trainer-globals (function none)) (defmethod start-run! ((this speedrun-info)) ;; turn on speedrun verification display (true! (-> this display-run-info?)) @@ -150,6 +151,9 @@ (send-event (ppointer->process *speedrun-manager*) 'start-run) ;; ensure any required settings are enabled (enforce-settings! this) + ;; make sure silly arena-trainer globals are reset if we're resetting from arena + (when (process-by-name "arena-training-1-collect" *entity-pool*) + (reset-arena-trainer-globals)) ;; finalize any category specific setup code (case (-> this category) (((speedrun-category newgame-normal))