jak3: fix some nan bugs (#3581)

Fixes a couple of NaN bugs, making the Arena and Marauder Stronghold
missions, the leaper corralling mission and final boss playable:

- Fixes #3579:
- After catching a leaper, the `flut` that spawns would have a NaN
`world-sphere`
- Fixes #3580:
- `vf0` was being clobbered after a `suspend`, causing them to spawn at
the origin.
- The Terraformer's `world-sphere` would be NaN until an animation
started playing.
This commit is contained in:
Hat Kid 2024-07-15 01:54:52 +02:00 committed by GitHub
parent 291c89a851
commit 08a23793c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View file

@ -603,6 +603,10 @@
(set! (-> self draw light-index) (the-as uint 30))
(logior! (-> self mask) (process-mask crate))
(cond
;; og:preserve-this hack to prevent NaNs
((= (-> self level name) 'desliz)
(go-virtual idle)
)
((logtest? arg3 (flut-flag ff2))
(go-virtual die)
)

View file

@ -557,6 +557,8 @@
)
)
)
;; og:preserve-this
(init-vf0-vector)
(.svf (&-> (-> gp-0 accel-array) 0 quad) vf0)
)
(go target-pilot-stance)

View file

@ -2329,6 +2329,8 @@
(terraformer-always)
)
:code sleep-code
;; og:preserve-this added post to prevent NaNs
:post ja-post
)
(defstate frozen (terraformer)

View file

@ -1609,7 +1609,8 @@
(set! (-> gp-0 r) 81920.0)
(when (not (and (-> self skip-jump) (not (sphere-in-view-frustum? gp-0))))
)
(suspend)
;; og:preserve-this prevent vf0 clobbering
; (suspend)
(when (and (-> self skip-jump) (not (sphere-in-view-frustum? gp-0)))
(let ((gp-1 (new 'stack-no-clear 'vector)))
(set! (-> gp-1 quad) (-> self root trans quad))
@ -1679,6 +1680,8 @@
(set! f28-0 1.0)
)
(suspend)
;; og:preserve-this fix vf0 clobbering after suspend
(init-vf0-vector)
(ja :num! (seek! max f30-0))
)
)