mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-03 06:33:14 +00:00
Prevent divide by zero in slopes code
Not exactly sure why this happens, or if this is the correct way to fix it
This commit is contained in:
parent
dca2193121
commit
e26bb897d6
1 changed files with 7 additions and 0 deletions
|
|
@ -54,6 +54,13 @@ static void P_ReconfigureVertexSlope(pslope_t *slope)
|
|||
max(max(abs(vec1.x), abs(vec1.y)), abs(vec1.z)),
|
||||
max(max(abs(vec2.x), abs(vec2.y)), abs(vec2.z))
|
||||
) >> (FRACBITS+5);
|
||||
|
||||
if (slope->extent == 0)
|
||||
{
|
||||
// Prevent divide by zero
|
||||
slope->extent = 1;
|
||||
}
|
||||
|
||||
vec1.x /= slope->extent;
|
||||
vec1.y /= slope->extent;
|
||||
vec1.z /= slope->extent;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue