- handle eel.cpp

This commit is contained in:
Christoph Oelckers 2022-09-04 22:55:13 +02:00
parent fd5cf15e0e
commit a95e7a9527

View file

@ -438,8 +438,6 @@ int NullEel(DSWActor* actor)
int DoEelMatchPlayerZ(DSWActor* actor) int DoEelMatchPlayerZ(DSWActor* actor)
{ {
int dist,a,b,c;
if (FAF_ConnectArea(actor->sector())) if (FAF_ConnectArea(actor->sector()))
{ {
if (actor->user.hi_sectp) if (actor->user.hi_sectp)
@ -483,8 +481,8 @@ int DoEelMatchPlayerZ(DSWActor* actor)
double bound; double bound;
if (actor->user.lowActor && actor->user.targetActor == actor->user.highActor) // this doesn't look right... if (actor->user.lowActor && actor->user.targetActor == actor->user.highActor) // this doesn't look right...
{ {
DISTANCE(actor->spr.pos, actor->user.lowActor->spr.pos, dist, a, b, c); double dist = (actor->spr.pos.XY() - actor->user.lowActor->spr.pos.XY()).Length();
if (dist <= 300) if (dist <= 18.75)
bound = actor->user.pos.Z; bound = actor->user.pos.Z;
else else
bound = loz - actor->user.floor_dist; bound = loz - actor->user.floor_dist;
@ -500,8 +498,8 @@ int DoEelMatchPlayerZ(DSWActor* actor)
// upper bound // upper bound
if (actor->user.highActor && actor->user.targetActor == actor->user.highActor) if (actor->user.highActor && actor->user.targetActor == actor->user.highActor)
{ {
DISTANCE(actor->spr.pos, actor->user.highActor->spr.pos, dist, a, b, c); double dist = (actor->spr.pos.XY() - actor->user.highActor->spr.pos.XY()).Length();
if (dist <= 300) if (dist <= 18.75)
bound = actor->user.pos.Z; bound = actor->user.pos.Z;
else else
bound = hiz + actor->user.ceiling_dist; bound = hiz + actor->user.ceiling_dist;