- floatified JS_ProcessEchoSpot

This commit is contained in:
Christoph Oelckers 2022-09-04 17:45:09 +02:00
parent 1501558139
commit fe8a059726

View file

@ -415,10 +415,8 @@ void drawroomstotile(int daposx, int daposy, int daposz,
} }
void void JS_ProcessEchoSpot()
JS_ProcessEchoSpot()
{ {
int j,dist;
PLAYER* pp = Player+screenpeek; PLAYER* pp = Player+screenpeek;
int16_t reverb; int16_t reverb;
bool reverb_set = false; bool reverb_set = false;
@ -427,14 +425,11 @@ JS_ProcessEchoSpot()
SWStatIterator it(STAT_ECHO); SWStatIterator it(STAT_ECHO);
while (auto actor = it.Next()) while (auto actor = it.Next())
{ {
dist = 0x7fffffff; double maxdist = SP_TAG4(actor) * maptoworld;
auto v = actor->spr.pos.XY() - pp->pos.XY();
double dist = abs(v.X) + abs(v.Y);
j = abs(actor->int_pos().X - pp->int_ppos().X); if (dist <= maxdist) // tag4 = ang
j += abs(actor->int_pos().Y - pp->int_ppos().Y);
if (j < dist)
dist = j;
if (dist <= SP_TAG4(actor)) // tag4 = ang
{ {
reverb = SP_TAG2(actor); reverb = SP_TAG2(actor);
if (reverb > 200) reverb = 200; if (reverb > 200) reverb = 200;