From cd28c818b0170cefc62d1c9e942cdb66a62e3804 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 13 Dec 2022 17:19:04 +0100 Subject: [PATCH] - fixed bad hitradius distance calculation. Player offset was retrieved from the wrong actor here. --- source/games/duke/src/actors_d.cpp | 2 +- source/games/duke/src/actors_r.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index b8850354b..d950c1ec2 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -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())) { diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 1873a86da..ecc45f194 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -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())) {