- Duke: Use getPosWithOffsetZ() in a few places.

This commit is contained in:
Mitchell Richters 2022-11-24 19:37:39 +11:00 committed by Christoph Oelckers
parent 4a6e2683f2
commit 4848a844af
2 changed files with 2 additions and 6 deletions

View file

@ -345,9 +345,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
continue; continue;
} }
if (act2->spr.picnum == APLAYER) act2->spr.pos.Z -= gs.playerheight; double dist = (actor->getPosWithOffsetZ() - act2->spr.pos).Length();
double dist = (actor->spr.pos - act2->spr.pos).Length();
if (act2->spr.picnum == APLAYER) act2->spr.pos.Z += gs.playerheight;
if (dist < radius && cansee(act2->spr.pos.plusZ(-8), act2->sector(), actor->spr.pos.plusZ(-12), actor->sector())) if (dist < radius && cansee(act2->spr.pos.plusZ(-8), act2->sector(), actor->spr.pos.plusZ(-12), actor->sector()))
{ {

View file

@ -292,9 +292,7 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
continue; continue;
} }
if (act2->spr.picnum == APLAYER) act2->spr.pos.Z -= gs.playerheight; double dist = (actor->getPosWithOffsetZ() - act2->spr.pos).Length();
double dist = (actor->spr.pos - act2->spr.pos).Length();
if (act2->spr.picnum == APLAYER) act2->spr.pos.Z += gs.playerheight;
if (dist < radius && cansee(act2->spr.pos.plusZ(-8), act2->sector(), actor->spr.pos.plusZ(-12), actor->sector())) if (dist < radius && cansee(act2->spr.pos.plusZ(-8), act2->sector(), actor->spr.pos.plusZ(-12), actor->sector()))
{ {