mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-22 19:21:28 +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)
|
void P_PlayerStartStomp(AActor *actor, bool mononly)
|
||||||
{
|
{
|
||||||
AActor *th;
|
FPortalGroupArray grouplist;
|
||||||
FBlockThingsIterator it(FBoundingBox(actor->X(), actor->Y(), actor->radius));
|
FMultiBlockThingsIterator mit(grouplist, actor);
|
||||||
|
FMultiBlockThingsIterator::CheckResult cres;
|
||||||
|
|
||||||
while ((th = it.Next()))
|
while ((mit.Next(&cres)))
|
||||||
{
|
{
|
||||||
|
AActor *th = cres.thing;
|
||||||
|
|
||||||
if (!(th->flags & MF_SHOOTABLE))
|
if (!(th->flags & MF_SHOOTABLE))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -543,7 +546,8 @@ void P_PlayerStartStomp(AActor *actor, bool mononly)
|
||||||
if (th == actor || (th->player == actor->player && th->player != NULL))
|
if (th == actor || (th->player == actor->player && th->player != NULL))
|
||||||
continue;
|
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;
|
continue;
|
||||||
|
|
||||||
// only kill monsters and other players
|
// only kill monsters and other players
|
||||||
|
|
Loading…
Reference in a new issue