Shift self-clip to first check for performance

This commit is contained in:
Edward Richardson 2015-08-30 22:02:36 +12:00
parent 1a25e35f3c
commit 389ff4fc98

View file

@ -1013,6 +1013,10 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm)
bool solid; bool solid;
int damage; int damage;
// don't clip against self
if (thing == tm.thing)
return true;
if (!((thing->flags & (MF_SOLID | MF_SPECIAL | MF_SHOOTABLE)) || thing->flags6 & MF6_TOUCHY)) if (!((thing->flags & (MF_SOLID | MF_SPECIAL | MF_SHOOTABLE)) || thing->flags6 & MF6_TOUCHY))
return true; // can't hit thing return true; // can't hit thing
@ -1020,10 +1024,6 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm)
if (abs(thing->x - tm.x) >= blockdist || abs(thing->y - tm.y) >= blockdist) if (abs(thing->x - tm.x) >= blockdist || abs(thing->y - tm.y) >= blockdist)
return true; return true;
// don't clip against self
if (thing == tm.thing)
return true;
if ((thing->flags2 | tm.thing->flags2) & MF2_THRUACTORS) if ((thing->flags2 | tm.thing->flags2) & MF2_THRUACTORS)
return true; return true;