- migrated P_PlayerStartStomp to FMultiThingIterator.

Note: This replaces AActor::intersects with a direct calculation. Although that function could be adjusted it'd mean some redundant distance calculations which are easily avoided.
This commit is contained in:
Christoph Oelckers 2016-02-20 23:07:37 +01:00
parent f8a8d8eed2
commit 26967bd0ee

View file

@ -531,11 +531,14 @@ bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefra
void P_PlayerStartStomp(AActor *actor, bool mononly)
{
AActor *th;
FBlockThingsIterator it(FBoundingBox(actor->X(), actor->Y(), actor->radius));
FPortalGroupArray grouplist;
FMultiBlockThingsIterator mit(grouplist, actor);
FMultiBlockThingsIterator::CheckResult cres;
while ((th = it.Next()))
while ((mit.Next(&cres)))
{
AActor *th = cres.thing;
if (!(th->flags & MF_SHOOTABLE))
continue;
@ -543,7 +546,8 @@ void P_PlayerStartStomp(AActor *actor, bool mononly)
if (th == actor || (th->player == actor->player && th->player != NULL))
continue;
if (!th->intersects(actor))
fixed_t blockdist = th->radius + actor->radius;
if (abs(th->X() - cres.position.x) >= blockdist || abs(th->Y() - cres.position.y) >= blockdist)
continue;
// only kill monsters and other players