From: terencehill Date: Tue, 7 Mar 2017 02:18:09 +0000 (+0100) Subject: Use -1 instead of an insanely high timeout X-Git-Tag: xonotic-v0.8.2~115 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0117ae7d3a9112024ff83615b16ba1df2d719521;p=xonotic%2Fxonotic-data.pk3dir.git Use -1 instead of an insanely high timeout --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 857d6222f..24cc29bdc 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -20,7 +20,7 @@ void navigation_dynamicgoal_init(entity this, bool initially_static) this.navigation_dynamicgoal = true; this.bot_basewaypoint = this.nearestwaypoint; if(initially_static) - this.nearestwaypointtimeout = time + 1000000000; + this.nearestwaypointtimeout = -1; else this.nearestwaypointtimeout = time; } @@ -34,7 +34,7 @@ void navigation_dynamicgoal_unset(entity this) { 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 @@ -821,7 +821,8 @@ void navigation_routerating(entity this, entity e, float f, float rangebias) } 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) diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc index bd920149b..e88967e8b 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -739,7 +739,7 @@ void waypoint_spawnforteleporter_boxes(entity e, vector org1, vector org2, vecto // 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) diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index d171dc6e0..3701c8015 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -926,7 +926,7 @@ spawnfunc(trigger_race_checkpoint) 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"; @@ -985,7 +985,7 @@ spawnfunc(target_checkpoint) // defrag entity 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 == "")