Skip to content

Fix float overflow in wall collision detection#928

Merged
gheskett merged 1 commit intoHackerN64:develop/2.4.0from
aglab2:fix-random-invi-walls
Mar 28, 2026
Merged

Fix float overflow in wall collision detection#928
gheskett merged 1 commit intoHackerN64:develop/2.4.0from
aglab2:fix-random-invi-walls

Conversation

@aglab2
Copy link
Copy Markdown
Collaborator

@aglab2 aglab2 commented Jan 24, 2026

invDenom can values can get very large, its upper limits are bounded by (LEVEL_BOUNDARY_MAX ^ 4) inverse of which could hover around 1E-16.

In my hack invDenom ended up being zero causing invisble walls bounded by XZ coordinates (maybe -ffast-math moment?). This patch removes necessity to do inverse by multiplying conditions in 'check_wall_vw'.

image

invDenom can values can get very large, its upper limits are bounded by
(LEVEL_BOUNDARY_MAX ^ 4) inverse of which could hover around 1E-16.

In my hack invDenom ended up being zero causing invisble walls
bounded by XZ coordinates. This patch removes necessity to do inverse
by multiplying conditions in 'check_wall_vw'.
@gheskett gheskett added the bug Something isn't working label Jan 24, 2026
@gheskett gheskett added vanilla This issue or feature exists in the vanilla game and removed vanilla This issue or feature exists in the vanilla game labels Jan 24, 2026
@gheskett gheskett added this to the 2.4 milestone Jan 24, 2026
@gheskett gheskett merged commit b602dea into HackerN64:develop/2.4.0 Mar 28, 2026
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in 2.4 (Minor Feature Update) Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants