[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:
Matt Dallmeyer
2026-07-23 13:44:51 -07:00
committed by GitHub
parent a306052e84
commit fcbcfb549a
+2 -1
View File
@@ -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)))))