Renamed flag to ALLOWTHRUBITS and rearranged the checks so the flag comes after.

- Since most will have 0 for the property, this will not check for the flag unless the mask fits.
This commit is contained in:
Major Cooke 2020-10-23 15:43:22 -05:00 committed by Christoph Oelckers
parent 85a121ad28
commit e3d21d09c9
3 changed files with 7 additions and 7 deletions

View file

@ -414,7 +414,7 @@ enum ActorFlag8
MF8_STOPRAILS = 0x00000200, // [MC] Prevent rails from going further if an actor has this flag.
MF8_ABSVIEWANGLES = 0x00000400, // [MC] By default view angle/pitch/roll is an offset. This will make it absolute instead.
MF8_FALLDAMAGE = 0x00000800, // Monster will take fall damage regardless of map settings.
MF8_THRUBITS = 0x00008000, // [MC] Enable ThruBits property
MF8_ALLOWTHRUBITS = 0x00008000, // [MC] Enable ThruBits property
};
// --- mobj.renderflags ---

View file

@ -450,7 +450,7 @@ bool P_TeleportMove(AActor* thing, const DVector3 &pos, bool telefrag, bool modi
if ((th->flags2 | tmf.thing->flags2) & MF2_THRUACTORS)
continue;
if (((th->flags8 | tmf.thing->flags8) & MF8_THRUBITS) && th->ThruBits & tmf.thing->ThruBits)
if ((th->ThruBits & tmf.thing->ThruBits) && ((th->flags8 | tmf.thing->flags8) & MF8_ALLOWTHRUBITS))
continue;
double blockdist = th->radius + tmf.thing->radius;
@ -1304,7 +1304,7 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch
if ((thing->flags2 | tm.thing->flags2) & MF2_THRUACTORS)
return true;
if (((thing->flags8 | tm.thing->flags8) & MF8_THRUBITS) && thing->ThruBits & tm.thing->ThruBits)
if ((thing->ThruBits & tm.thing->ThruBits) && ((thing->flags8 | tm.thing->flags8) & MF8_ALLOWTHRUBITS))
return true;
if (!((thing->flags & (MF_SOLID | MF_SPECIAL | MF_SHOOTABLE)) || thing->flags6 & MF6_TOUCHY))
@ -2000,7 +2000,7 @@ int P_TestMobjZ(AActor *actor, bool quick, AActor **pOnmobj)
{
continue;
}
if (((actor->flags8 | thing->flags8) & MF8_THRUBITS) && actor->ThruBits & thing->ThruBits)
if ((actor->ThruBits & thing->ThruBits) && ((actor->flags8 | thing->flags8) & MF8_ALLOWTHRUBITS))
{
continue;
}
@ -4509,7 +4509,7 @@ AActor *P_LineAttack(AActor *t1, DAngle angle, double distance,
if (tempuff != NULL)
{
TData.PuffSpecies = tempuff->GetSpecies();
TData.UseThruBits = tempuff->flags8 & MF8_THRUBITS;
TData.UseThruBits = tempuff->flags8 & MF8_ALLOWTHRUBITS;
TData.ThruBits = tempuff->ThruBits;
tempuff->Destroy();
}
@ -5269,7 +5269,7 @@ void P_RailAttack(FRailParams *p)
{
rail_data.ThruBits = thepuff->ThruBits;
if (rail_data.UseThruBits)
rail_data.UseThruBits = (thepuff->flags8 & MF8_THRUBITS);
rail_data.UseThruBits = !!(thepuff->flags8 & MF8_ALLOWTHRUBITS);
}
Trace(start, source->Sector, vec, p->distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace, flags, ProcessRailHit, &rail_data);

View file

@ -327,7 +327,7 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(MF8, STOPRAILS, AActor, flags8),
DEFINE_FLAG(MF8, FALLDAMAGE, AActor, flags8),
DEFINE_FLAG(MF8, ABSVIEWANGLES, AActor, flags8),
DEFINE_FLAG(MF8, THRUBITS, AActor, flags8),
DEFINE_FLAG(MF8, ALLOWTHRUBITS, AActor, flags8),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),