Fix: Peacemaker rockets weren't targetting properly.
This commit is contained in:
parent
e562754f00
commit
ea63ade02d
1 changed files with 4 additions and 1 deletions
|
|
@ -81,11 +81,14 @@ Class PeaceRocket : Actor
|
||||||
action void A_CheckForTargets()
|
action void A_CheckForTargets()
|
||||||
{
|
{
|
||||||
let bi = BlockThingsIterator.Create(self,500);
|
let bi = BlockThingsIterator.Create(self,500);
|
||||||
|
double mindist = double.infinity;
|
||||||
while ( bi.Next() )
|
while ( bi.Next() )
|
||||||
{
|
{
|
||||||
if ( !bi.Thing || (!bi.Thing.bISMONSTER && !bi.Thing.player) || (bi.Thing.Health <= 0) || (Distance3D(bi.Thing) > 500) || !CheckSight(bi.Thing) ) continue;
|
if ( !bi.Thing || (!bi.Thing.bISMONSTER && !bi.Thing.player) || (bi.Thing.Health <= 0) || (Distance3D(bi.Thing) > 500) || !CheckSight(bi.Thing) ) continue;
|
||||||
|
double dist = Distance3D(bi.Thing);
|
||||||
|
if ( dist > mindist ) break;
|
||||||
tracer = bi.Thing;
|
tracer = bi.Thing;
|
||||||
return;
|
mindist = dist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
action void A_SeekTargets()
|
action void A_SeekTargets()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue