mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Waterskiing stepdown improvement
Only prohibits when there's a valid stepdown if the object is on a sloping surface. Fixes Mega Aqua Lake without breaking Water Palace or a modified Nova Shore (after addition of an extra downward slope)
This commit is contained in:
parent
3422efb2fd
commit
a558c4f5c0
1 changed files with 11 additions and 10 deletions
17
src/p_mobj.c
17
src/p_mobj.c
|
|
@ -3119,9 +3119,6 @@ boolean P_CanRunOnWater(mobj_t *mobj, ffloor_t *rover)
|
||||||
fixed_t surfaceheight = INT32_MAX;
|
fixed_t surfaceheight = INT32_MAX;
|
||||||
fixed_t surfDiff = INT32_MAX;
|
fixed_t surfDiff = INT32_MAX;
|
||||||
|
|
||||||
fixed_t floorheight = INT32_MAX;
|
|
||||||
fixed_t floorDiff = INT32_MAX;
|
|
||||||
|
|
||||||
fixed_t mobjbottom = INT32_MAX;
|
fixed_t mobjbottom = INT32_MAX;
|
||||||
fixed_t maxStep = INT32_MAX;
|
fixed_t maxStep = INT32_MAX;
|
||||||
boolean doifit = false;
|
boolean doifit = false;
|
||||||
|
|
@ -3210,17 +3207,21 @@ boolean P_CanRunOnWater(mobj_t *mobj, ffloor_t *rover)
|
||||||
maxStep = P_GetThingStepUp(mobj, mobj->x, mobj->y);
|
maxStep = P_GetThingStepUp(mobj, mobj->x, mobj->y);
|
||||||
|
|
||||||
surfDiff = flip ? (surfaceheight - mobjbottom) : (mobjbottom - surfaceheight);
|
surfDiff = flip ? (surfaceheight - mobjbottom) : (mobjbottom - surfaceheight);
|
||||||
|
|
||||||
|
// We start water run IF we can step onto it!
|
||||||
if (surfDiff <= maxStep && surfDiff >= 0)
|
if (surfDiff <= maxStep && surfDiff >= 0)
|
||||||
{
|
{
|
||||||
// We start water run IF we can step-down!
|
if (ourZAng < 0)
|
||||||
floorheight = flip ? P_GetSectorCeilingZAt(mobj->subsector->sector, mobj->x, mobj->y) : P_GetSectorFloorZAt(mobj->subsector->sector, mobj->x, mobj->y);
|
|
||||||
floorDiff = flip ? (floorheight - mobjbottom) : (mobjbottom - floorheight);
|
|
||||||
if (floorDiff <= maxStep && floorDiff >= 0)
|
|
||||||
{
|
{
|
||||||
// ... but NOT if real floor is in range.
|
fixed_t floorheight = flip ? P_GetSectorCeilingZAt(mobj->subsector->sector, mobj->x, mobj->y) : P_GetSectorFloorZAt(mobj->subsector->sector, mobj->x, mobj->y);
|
||||||
|
fixed_t floorDiff = flip ? (floorheight - mobjbottom) : (mobjbottom - floorheight);
|
||||||
|
if (floorDiff <= maxStep && floorDiff >= -maxStep)
|
||||||
|
{
|
||||||
|
// ... but NOT if going down and real floor is in range.
|
||||||
// FIXME: Count solid FOFs in this check
|
// FIXME: Count solid FOFs in this check
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue