mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix equation slopes overflow
This commit is contained in:
parent
b689e0adf2
commit
915bf83172
1 changed files with 5 additions and 1 deletions
|
|
@ -201,10 +201,14 @@ void P_ReconfigureViaVertexes (pslope_t *slope, const vector3_t v1, const vector
|
||||||
static void ReconfigureViaConstants (pslope_t *slope, const fixed_t a, const fixed_t b, const fixed_t c, const fixed_t d)
|
static void ReconfigureViaConstants (pslope_t *slope, const fixed_t a, const fixed_t b, const fixed_t c, const fixed_t d)
|
||||||
{
|
{
|
||||||
fixed_t m;
|
fixed_t m;
|
||||||
|
fixed_t o = 0;
|
||||||
vector3_t *normal = &slope->normal;
|
vector3_t *normal = &slope->normal;
|
||||||
|
|
||||||
|
if (c)
|
||||||
|
o = abs(c) <= FRACUNIT ? -FixedMul(d, FixedDiv(FRACUNIT, c)) : -FixedDiv(d, c);
|
||||||
|
|
||||||
// Set origin.
|
// Set origin.
|
||||||
FV3_Load(&slope->o, 0, 0, c ? -FixedDiv(d, c) : 0);
|
FV3_Load(&slope->o, 0, 0, o);
|
||||||
|
|
||||||
// Get slope's normal.
|
// Get slope's normal.
|
||||||
FV3_Load(normal, a, b, c);
|
FV3_Load(normal, a, b, c);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue