Skip to content

Commit

Permalink
Renamed flag to ALLOWTHRUBITS and rearranged the checks so the flag c…
Browse files Browse the repository at this point in the history
…omes after.

- Since most will have 0 for the property, this will not check for the flag unless the mask fits.
  • Loading branch information
MajorCooke authored and coelckers committed Oct 25, 2020
1 parent 85a121a commit e3d21d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/playsim/actor.h
Expand Up @@ -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 ---
Expand Down
10 changes: 5 additions & 5 deletions src/playsim/p_map.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/scripting/thingdef_data.cpp
Expand Up @@ -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),
Expand Down

0 comments on commit e3d21d0

Please sign in to comment.