mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- 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:
parent
f8a8d8eed2
commit
26967bd0ee
1 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue