Merge branch 'ambush-fix' into 'next'

Re-add code that sets MF2_AMBUSH if MTF_AMBUSH is set, but only for binary maps

Closes #958

See merge request STJr/SRB2!1937
This commit is contained in:
sphere 2023-02-28 13:59:38 +00:00
commit 171f5ac21c

View file

@ -13280,6 +13280,23 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
return true;
}
// Pre-UDMF backwards compatibility stuff. Remove for 2.3
static void P_SetAmbush(mapthing_t *mthing, mobj_t *mobj)
{
if (mobj->type == MT_NIGHTSBUMPER
|| mobj->type == MT_AXIS
|| mobj->type == MT_AXISTRANSFER
|| mobj->type == MT_AXISTRANSFERLINE
|| mobj->type == MT_NIGHTSBUMPER
|| mobj->type == MT_STARPOST)
return;
if ((mthing->options & MTF_OBJECTSPECIAL) && (mobj->flags & MF_PUSHABLE))
return;
mobj->flags2 |= MF2_AMBUSH;
}
static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y, fixed_t z, mobjtype_t i)
{
mobj_t *mobj = NULL;
@ -13302,6 +13319,9 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y,
mthing->mobj = mobj;
if (!udmf && (mthing->options & MTF_AMBUSH))
P_SetAmbush(mthing, mobj);
// Generic reverse gravity for individual objects flag.
if (mthing->options & MTF_OBJECTFLIP)
{