From 23262ce269facbc4bd3d432d2030595c42bad1ea Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sun, 1 Jun 2025 18:50:11 -0400 Subject: [PATCH] g/j2: add hack workaround to prevent `atoll-sig` mission getting stuck due to NaN bones (#3935) Related to #3929 Played through the mission, worked fine. This condition should _never_ be hit under normal circumstances --- goal_src/jak2/levels/common/ai/sig/sig.gc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/goal_src/jak2/levels/common/ai/sig/sig.gc b/goal_src/jak2/levels/common/ai/sig/sig.gc index 49bb55eca1..9a57ec0a55 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig.gc @@ -1438,3 +1438,14 @@ 0 (none) ) + +;; og:preserve-this Hack to prevent this issue from happening again - https://github.com/open-goal/jak-project/issues/3929 +;; this should be safe because you never interact with an enemy at the origin, especially the snipers +(defmethod enemy-method-95 ((this sig) (arg0 vector) (arg1 float)) + (when (and (= 0.0 (-> arg0 x)) (= 0.0 (-> arg0 y)) (= 0.0 (-> arg0 z))) + (format 0 "HACK: sig::95 got a zero'd vector, implying NaNs, see issue #3929, returning true~%") + (return #t)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) + (enemy-method-94 this v1-1 arg1) + ) + )