mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 04:21:23 +00:00
Add flag to per-sector gravity for overriding MF2_OBJECTFLIP
This commit is contained in:
parent
8d06145377
commit
1f73c9cf99
4 changed files with 13 additions and 0 deletions
|
@ -578,6 +578,7 @@ linedeftypes
|
||||||
title = "Per-Sector Gravity";
|
title = "Per-Sector Gravity";
|
||||||
prefix = "(1)";
|
prefix = "(1)";
|
||||||
flags64text = "[6] Flip in reverse gravity";
|
flags64text = "[6] Flip in reverse gravity";
|
||||||
|
flags8192text = "[13] Override MF2_OBJECTFLIP";
|
||||||
}
|
}
|
||||||
|
|
||||||
5
|
5
|
||||||
|
|
|
@ -1464,7 +1464,11 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
||||||
gravityadd = -FixedMul(gravity, gravfactor);
|
gravityadd = -FixedMul(gravity, gravfactor);
|
||||||
|
|
||||||
if ((rover->master->frontsector->flags & MSF_GRAVITYFLIP) && gravityadd > 0)
|
if ((rover->master->frontsector->flags & MSF_GRAVITYFLIP) && gravityadd > 0)
|
||||||
|
{
|
||||||
|
if (rover->master->frontsector->specialflags & SSF_GRAVITYOVERRIDE)
|
||||||
|
mo->flags2 &= ~MF2_OBJECTFLIP;
|
||||||
mo->eflags |= MFE_VERTICALFLIP;
|
mo->eflags |= MFE_VERTICALFLIP;
|
||||||
|
}
|
||||||
|
|
||||||
no3dfloorgrav = false;
|
no3dfloorgrav = false;
|
||||||
break;
|
break;
|
||||||
|
@ -1476,8 +1480,12 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
||||||
gravityadd = -FixedMul(gravity, P_GetSectorGravityFactor(mo->subsector->sector));
|
gravityadd = -FixedMul(gravity, P_GetSectorGravityFactor(mo->subsector->sector));
|
||||||
|
|
||||||
if ((mo->subsector->sector->flags & MSF_GRAVITYFLIP) && gravityadd > 0)
|
if ((mo->subsector->sector->flags & MSF_GRAVITYFLIP) && gravityadd > 0)
|
||||||
|
{
|
||||||
|
if (mo->subsector->sector->specialflags & SSF_GRAVITYOVERRIDE)
|
||||||
|
mo->flags2 &= ~MF2_OBJECTFLIP;
|
||||||
mo->eflags |= MFE_VERTICALFLIP;
|
mo->eflags |= MFE_VERTICALFLIP;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Less gravity underwater.
|
// Less gravity underwater.
|
||||||
if (mo->eflags & MFE_UNDERWATER && !goopgravity)
|
if (mo->eflags & MFE_UNDERWATER && !goopgravity)
|
||||||
|
|
|
@ -6283,6 +6283,9 @@ void P_SpawnSpecials(boolean fromnetsave)
|
||||||
else
|
else
|
||||||
sectors[s].flags &= ~MSF_GRAVITYFLIP;
|
sectors[s].flags &= ~MSF_GRAVITYFLIP;
|
||||||
|
|
||||||
|
if (lines[i].flags & ML_EFFECT6)
|
||||||
|
sectors[s].specialflags |= SSF_GRAVITYOVERRIDE;
|
||||||
|
|
||||||
CheckForReverseGravity |= (sectors[s].flags & MSF_GRAVITYFLIP);
|
CheckForReverseGravity |= (sectors[s].flags & MSF_GRAVITYFLIP);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -315,6 +315,7 @@ typedef enum
|
||||||
SSF_FINISHLINE = 1<<17,
|
SSF_FINISHLINE = 1<<17,
|
||||||
SSF_ROPEHANG = 1<<18,
|
SSF_ROPEHANG = 1<<18,
|
||||||
SSF_JUMPFLIP = 1<<19,
|
SSF_JUMPFLIP = 1<<19,
|
||||||
|
SSF_GRAVITYOVERRIDE = 1<<20,
|
||||||
} sectorspecialflags_t;
|
} sectorspecialflags_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
Loading…
Reference in a new issue