Add flag to per-sector gravity for overriding MF2_OBJECTFLIP

This commit is contained in:
spherallic 2022-09-11 16:15:50 +02:00
parent 8d06145377
commit 1f73c9cf99
4 changed files with 13 additions and 0 deletions

View file

@ -578,6 +578,7 @@ linedeftypes
title = "Per-Sector Gravity";
prefix = "(1)";
flags64text = "[6] Flip in reverse gravity";
flags8192text = "[13] Override MF2_OBJECTFLIP";
}
5

View file

@ -1464,7 +1464,11 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
gravityadd = -FixedMul(gravity, gravfactor);
if ((rover->master->frontsector->flags & MSF_GRAVITYFLIP) && gravityadd > 0)
{
if (rover->master->frontsector->specialflags & SSF_GRAVITYOVERRIDE)
mo->flags2 &= ~MF2_OBJECTFLIP;
mo->eflags |= MFE_VERTICALFLIP;
}
no3dfloorgrav = false;
break;
@ -1476,7 +1480,11 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
gravityadd = -FixedMul(gravity, P_GetSectorGravityFactor(mo->subsector->sector));
if ((mo->subsector->sector->flags & MSF_GRAVITYFLIP) && gravityadd > 0)
{
if (mo->subsector->sector->specialflags & SSF_GRAVITYOVERRIDE)
mo->flags2 &= ~MF2_OBJECTFLIP;
mo->eflags |= MFE_VERTICALFLIP;
}
}
// Less gravity underwater.

View file

@ -6283,6 +6283,9 @@ void P_SpawnSpecials(boolean fromnetsave)
else
sectors[s].flags &= ~MSF_GRAVITYFLIP;
if (lines[i].flags & ML_EFFECT6)
sectors[s].specialflags |= SSF_GRAVITYOVERRIDE;
CheckForReverseGravity |= (sectors[s].flags & MSF_GRAVITYFLIP);
}
break;

View file

@ -315,6 +315,7 @@ typedef enum
SSF_FINISHLINE = 1<<17,
SSF_ROPEHANG = 1<<18,
SSF_JUMPFLIP = 1<<19,
SSF_GRAVITYOVERRIDE = 1<<20,
} sectorspecialflags_t;
typedef enum