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

Merge branch 'fix-equation-slopes-near-edges' into 'next'

Fix equation slopes breaking with slopes farther than 32k FU away from the map center

See merge request STJr/SRB2!2397
parents af8337cd c3a8f452
No related branches found
No related tags found
1 merge request!2397Fix equation slopes breaking with slopes farther than 32k FU away from the map center
Pipeline #4286 canceled
...@@ -933,10 +933,10 @@ void P_InitSlopes(void) ...@@ -933,10 +933,10 @@ void P_InitSlopes(void)
// Returns the height of the sloped plane at (x, y) as a fixed_t // Returns the height of the sloped plane at (x, y) as a fixed_t
fixed_t P_GetSlopeZAt(const pslope_t *slope, fixed_t x, fixed_t y) fixed_t P_GetSlopeZAt(const pslope_t *slope, fixed_t x, fixed_t y)
{ {
fixed_t dist = FixedMul(x - slope->o.x, slope->d.x) + fixed_t dist = FixedMul(x - slope->o.x, slope->d.x) / 2 +
FixedMul(y - slope->o.y, slope->d.y); FixedMul(y - slope->o.y, slope->d.y) / 2;
return slope->o.z + FixedMul(dist, slope->zdelta); return slope->o.z + FixedMul(dist, slope->zdelta) * 2;
} }
// Like P_GetSlopeZAt but falls back to z if slope is NULL // Like P_GetSlopeZAt but falls back to z if slope is NULL
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment