Skip to content

Commit

Permalink
jak3: fix robo-hover hand cannon nans (#3584)
Browse files Browse the repository at this point in the history
Fixes #3583.

The callback function for the hand cannon joint mods was initialized
prior to calling `ja-post`, propagating NaNs.
  • Loading branch information
Hat-Kid authored Jul 15, 2024
1 parent b8f1ee5 commit 1c170b7
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions goal_src/jak3/levels/common/enemy/hover/robo-hover.gc
Original file line number Diff line number Diff line change
Expand Up @@ -1676,16 +1676,17 @@
(set! (-> this root dynam gravity y) 327680.0)
(set! (-> this root dynam gravity-length) 327680.0)
(set! (-> this root dynam gravity-max) 327680.0)
(let ((a0-7 (-> this node-list data 10)))
(set! (-> a0-7 param0) robo-hover-arm-jmod)
(set! (-> a0-7 param1) this)
(set! (-> a0-7 param2) (the-as basic 0))
)
(let ((v1-23 (-> this node-list data 14)))
(set! (-> v1-23 param0) robo-hover-arm-jmod)
(set! (-> v1-23 param1) this)
(set! (-> v1-23 param2) (the-as basic 1))
)
;; og:preserve-this moved to after ja-post
; (let ((a0-7 (-> this node-list data 10)))
; (set! (-> a0-7 param0) robo-hover-arm-jmod)
; (set! (-> a0-7 param1) this)
; (set! (-> a0-7 param2) (the-as basic 0))
; )
; (let ((v1-23 (-> this node-list data 14)))
; (set! (-> v1-23 param0) robo-hover-arm-jmod)
; (set! (-> v1-23 param1) this)
; (set! (-> v1-23 param2) (the-as basic 1))
; )
(logior! (-> this mask) (process-mask kg-robot))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup))
Expand Down Expand Up @@ -1756,6 +1757,17 @@
(joint-control-channel-group! a0-42 (the-as art-joint-anim (-> this draw art-group data 9)) num-func-identity)
)
(ja-post)
;; og:preserve-this
(let ((a0-7 (-> this node-list data 10)))
(set! (-> a0-7 param0) robo-hover-arm-jmod)
(set! (-> a0-7 param1) this)
(set! (-> a0-7 param2) (the-as basic 0))
)
(let ((v1-23 (-> this node-list data 14)))
(set! (-> v1-23 param0) robo-hover-arm-jmod)
(set! (-> v1-23 param1) this)
(set! (-> v1-23 param2) (the-as basic 1))
)
(quaternion-from-two-vectors!
(the-as quaternion (-> this wrist-quat))
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 14 bone transform uvec) 1.0)
Expand Down

0 comments on commit 1c170b7

Please sign in to comment.