mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Fix NaN position bug with fixed collision (#312)
* Fix fixed collision NaN position Thanks to @Marioiscool246 for figuring this out. Sometimes Mario's position will become NaN when doing specific things, this fixes that. Co-Authored-By: Marioiscool246 <27823923+Marioiscool246@users.noreply.github.com> * Formatting Co-Authored-By: Marioiscool246 <27823923+Marioiscool246@users.noreply.github.com> * Fix ordering * Final fix(?) --------- Co-authored-by: Marioiscool246 <27823923+Marioiscool246@users.noreply.github.com>
This commit is contained in:
parent
42b43a9b7e
commit
7f6f7fea47
1 changed files with 4 additions and 0 deletions
|
|
@ -164,6 +164,10 @@ static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode,
|
|||
f32 dist = sqrtf(dX * dX + dZ * dZ);
|
||||
if (dist > radius) { continue; }
|
||||
|
||||
if (dist < __FLT_EPSILON__) {
|
||||
dist = __FLT_EPSILON__;
|
||||
}
|
||||
|
||||
cNorm[0] = dX / dist;
|
||||
cNorm[1] = 0;
|
||||
cNorm[2] = dZ / dist;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue