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

This commit is contained in:
MascaraSnake 2023-02-25 15:03:52 +01:00
parent 707860815b
commit 6e7ff69720

View file

@ -13277,6 +13277,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;
@ -13299,6 +13316,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)
{