this.navigation_dynamicgoal = true;
this.bot_basewaypoint = this.nearestwaypoint;
if(initially_static)
- this.nearestwaypointtimeout = time + 1000000000;
+ this.nearestwaypointtimeout = -1;
else
this.nearestwaypointtimeout = time;
}
{
if(this.bot_basewaypoint)
this.nearestwaypoint = this.bot_basewaypoint;
- this.nearestwaypointtimeout = time + 1000000000;
+ this.nearestwaypointtimeout = -1;
}
// rough simulation of walking from one point to another to test if a path
}
else
{
- if ((!e.nearestwaypoint || e.navigation_dynamicgoal) && time > e.nearestwaypointtimeout)
+ if ((!e.nearestwaypoint || e.navigation_dynamicgoal)
+ && e.nearestwaypointtimeout >= 0 && time > e.nearestwaypointtimeout)
{
nwp = navigation_findnearestwaypoint(e, true);
if(nwp)
// the teleporter's nearest spawnfunc_waypoint is this one
// (teleporters are not goals, so this is probably useless)
e.nearestwaypoint = w;
- e.nearestwaypointtimeout = time + 1000000000;
+ e.nearestwaypointtimeout = -1;
}
void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken)
o = (this.absmin + this.absmax) * 0.5;
tracebox(o, PL_MIN_CONST, PL_MAX_CONST, o - '0 0 1' * (o.z - this.absmin.z), MOVE_NORMAL, this);
waypoint_spawnforitem_force(this, trace_endpos);
- this.nearestwaypointtimeout = time + 1000000000;
+ this.nearestwaypointtimeout = -1;
if(this.message == "")
this.message = "went backwards";
org = (this.absmin + this.absmax) * 0.5;
tracebox(org, PL_MIN_CONST, PL_MAX_CONST, org - '0 0 1' * (org.z - this.absmin.z), MOVE_NORMAL, this);
waypoint_spawnforitem_force(this, trace_endpos);
- this.nearestwaypointtimeout = time + 1000000000;
+ this.nearestwaypointtimeout = -1;
}
if(this.message == "")