Skip to content

Fix float overflow in wall collision detection#928

Open
aglab2 wants to merge 1 commit intoHackerN64:develop/2.4.0from
aglab2:fix-random-invi-walls
Open

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

Conversation

@aglab2
Copy link
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
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: Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants