Skip to content
Snippets Groups Projects
Commit fad7c429 authored by sphere's avatar sphere
Browse files

Merge branch 'udmf-equation-slopes' into 'next'

Fix equation slopes overflow

Closes #757

See merge request STJr/SRB2!1830
parents deaa82aa dff15fa6
Branches
Tags
1 merge request!1830Fix equation slopes overflow
......@@ -94,10 +94,14 @@ static void ReconfigureViaVertexes (pslope_t *slope, const vector3_t v1, const v
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 o = 0;
vector3_t *normal = &slope->normal;
if (c)
o = abs(c) <= FRACUNIT ? -FixedMul(d, FixedDiv(FRACUNIT, c)) : -FixedDiv(d, c);
// Set origin.
FV3_Load(&slope->o, 0, 0, c ? -FixedDiv(d, c) : 0);
FV3_Load(&slope->o, 0, 0, o);
// Get slope's normal.
FV3_Load(normal, a, b, c);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment