mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 11:11:16 +00:00
- fixed a few bad length calculations
This commit is contained in:
parent
0e57a9f3c7
commit
b2b1522185
4 changed files with 5 additions and 5 deletions
|
@ -1343,7 +1343,7 @@ int InitActorDuck(DSWActor* actor)
|
|||
actor->user.ActorActionFunc = DoActorDuck;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Duck);
|
||||
|
||||
double dist = (actor->spr.pos.XY(), actor->user.targetActor->spr.pos.XY()).LengthSquared();
|
||||
double dist = (actor->spr.pos.XY() - actor->user.targetActor->spr.pos.XY()).LengthSquared();
|
||||
|
||||
if (dist > 500*500)
|
||||
{
|
||||
|
@ -1644,7 +1644,7 @@ int InitActorReposition(DSWActor* actor)
|
|||
actor->user.Dist = 0;
|
||||
|
||||
rnum = RANDOM_P2(8<<8)>>8;
|
||||
dist = (actor->spr.pos.XY(), actor->user.targetActor->spr.pos.XY()).Length();
|
||||
dist = (actor->spr.pos.XY() - actor->user.targetActor->spr.pos.XY()).Length();
|
||||
|
||||
if (dist < PlayerDist[rnum] || (actor->user.Flags & SPR_RUN_AWAY))
|
||||
{
|
||||
|
|
|
@ -2938,7 +2938,7 @@ void DoSector(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
double dist = (pp->pos.XY(), sop->pmid.XY()).Length();
|
||||
double dist = (pp->pos.XY() - sop->pmid.XY()).Length();
|
||||
if (dist < min_dist)
|
||||
min_dist = dist;
|
||||
}
|
||||
|
|
|
@ -860,7 +860,7 @@ int DoBettySpawnShrap(DSWActor* actor)
|
|||
|
||||
int DoBettyWait(DSWActor* actor)
|
||||
{
|
||||
double dist = (actor->spr.pos.XY(), actor->user.targetActor->spr.pos.XY()).Length();
|
||||
double dist = (actor->spr.pos.XY() - actor->user.targetActor->spr.pos.XY()).Length();
|
||||
|
||||
DoActorPickClosePlayer(actor);
|
||||
|
||||
|
|
|
@ -18287,7 +18287,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, DAngle bang)
|
|||
return nullptr;
|
||||
|
||||
const double WALLBLOOD_DIST_MAX = 156.25;
|
||||
if ((hit.hitpos.XY(), actor->spr.pos.XY()).Length() > WALLBLOOD_DIST_MAX)
|
||||
if ((hit.hitpos.XY() - actor->spr.pos.XY()).Length() > WALLBLOOD_DIST_MAX)
|
||||
return nullptr;
|
||||
|
||||
// hit a sprite?
|
||||
|
|
Loading…
Reference in a new issue