mirror of
https://github.com/open-goal/jak-project
synced 2026-05-31 01:16:12 -04:00
5b75cb74df
Another patch to prevent NaN propagation. Still doesn't address the root cause of the NaNs, but should fix some mission behavior. In some cases, crimson-guards will [return NaN vectors for their `bullseye-joint`](https://github.com/open-goal/jak-project/blob/1dff57182004f058848b26f0f8bfbb111a96e480/goal_src/jak3/engine/ai/enemy.gc#L178-L183). I suspect the root cause of these NaNs may be related to the guards missing their torsos <img width="1202" height="692" alt="image" src="https://github.com/user-attachments/assets/c1a91266-cd50-44f9-80cb-de9b9415d36b" /> In the [spydroid's `attack` state](https://github.com/open-goal/jak-project/blob/1dff57182004f058848b26f0f8bfbb111a96e480/goal_src/jak3/levels/common/enemy/spydroid.gc#L743-L772), this NaN value will end up propagating to the spydroid's position. This in turn causes issues like the infinite looping addressed in #4225. Or another issue in "Defend HQ From Attack" - every spydroid spawned by the task manager can end up with NaN positions. The spydroids will be nowhere to be seen, but the task-manager still considers them alive and won't spawn any other KG enemies.