Optimized P_TestMobjZ by not running the iterator if actor also has THRUACTORS.

This commit is contained in:
Major Cooke 2021-12-24 14:26:29 -06:00 committed by Rachael Alexanderson
parent 688e5ac694
commit 6432e4f6a8

View file

@ -1993,7 +1993,7 @@ int P_TestMobjZ(AActor *actor, bool quick, AActor **pOnmobj)
{
AActor *onmobj = nullptr;
if (pOnmobj) *pOnmobj = nullptr;
if (actor->flags & MF_NOCLIP)
if ((actor->flags & MF_NOCLIP) || (actor->flags2 & MF2_THRUACTORS))
{
return true;
}
@ -2011,7 +2011,7 @@ int P_TestMobjZ(AActor *actor, bool quick, AActor **pOnmobj)
{
continue;
}
if ((actor->flags2 | thing->flags2) & MF2_THRUACTORS)
if (thing->flags2 & MF2_THRUACTORS)
{
continue;
}