if (!this.goalcurrent.wpisbox // warpzone
&& vlen2(this.origin - this.goalstack01.origin) < vlen2(this.origin - this.goalcurrent.origin))
{
+ // immediately remove origin and destination waypoints
navigation_poproute(this);
++removed_goals;
navigation_poproute(this);
++removed_goals;
- return removed_goals;
+ this.lastteleporttime = 0;
}
// make sure jumppad is really hit, don't rely on distance based checks
if (time - this.lastteleporttime < random() * max_delay)
return removed_goals;
}
+ else if (this.goalcurrent.wpisbox) // teleport
+ {
+ // immediately remove origin and destination waypoints
+ navigation_poproute(this);
+ ++removed_goals;
+ }
navigation_poproute(this);
this.lastteleporttime = 0;
++removed_goals;
}
- else
- return removed_goals;
+ return removed_goals;
}
else if (this.lastteleporttime > 0)
{
++removed_goals;
return removed_goals;
}
+ // reset of lastteleporttime can be overriden by a jumppad when it's set
+ // in more than one frame: make sure it's reset
+ this.lastteleporttime = 0;
}
// Loose goal touching check when running