- fixed bad hitradius distance calculation.

Player offset was retrieved from the wrong actor here.
This commit is contained in:
Christoph Oelckers 2022-12-13 17:19:04 +01:00
parent fba882e368
commit cd28c818b0
2 changed files with 2 additions and 2 deletions

View file

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

View file

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