mirror of
https://github.com/open-goal/jak-project
synced 2026-08-05 09:34:51 -04:00
[jak1] Reinstate NaN check in nav code (#4359)
Inadvertently removed as part of improved decompiler stack variable support #4222 We suspect this is the reason some nav-enemies have been randomly disappearing in recent mods/versions Thanks Evelyn for catching the regression
This commit is contained in:
@@ -1310,7 +1310,8 @@
|
||||
(let ((sv-96 (-> sv-80 sphere (-> sv-80 num-spheres)))
|
||||
(f1-3 (vector-vector-xz-distance-squared sv-112 (-> sv-80 shape trans)))
|
||||
(f0-9 (+ (-> sv-112 w) (-> sv-80 shape nav-radius))))
|
||||
(when (< f1-3 (square (+ 40960.0 f0-9)))
|
||||
;; og:preserve-this added a NaN check here. it seems like some enemies have bogus positions (maybe on their first frame?)
|
||||
(when (and (< f1-3 (square (+ 40960.0 f0-9))) (not (is-nan? (-> sv-112 x))))
|
||||
(vector-! (the-as vector sv-96) sv-112 (-> sv-80 mesh origin))
|
||||
(set! (-> sv-96 w) f0-9)
|
||||
(+! (-> sv-80 num-spheres) 1)))))
|
||||
|
||||
Reference in New Issue
Block a user