From 6dd05dda1f8d9215e827e149aba52a402136a488 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 25 Dec 2016 10:06:49 +0100 Subject: [PATCH] Remove path to unreachable goals that lead to falling off the map (example case: on Xoylent from the upper Mega Armor down to the hole to the lowest level when the mortar is picked up) --- qcsrc/server/bot/default/havocbot/havocbot.qc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index b3c0f58d91..80dc706e95 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -778,7 +778,17 @@ void havocbot_movetogoal(entity this) { tracebox(dst_ahead, this.mins, this.maxs, dst_down, true, this); if (tracebox_hits_trigger_hurt(dst_ahead, this.mins, this.maxs, trace_endpos)) - evadelava = normalize(this.velocity) * -1; + { + if (gco.z > this.origin.z + jumpstepheightvec.z) + { + // the goal is probably on an upper platform, assume bot can't get there + LOG_TRACE("bot ", this.netname, " avoided the goal ", this.goalcurrent.classname, " ", etos(this.goalcurrent), " because it led to a dangerous path; goal stack cleared"); + navigation_clearroute(this); + this.bot_strategytime = 0; + } + else + evadelava = normalize(this.velocity) * -1; + } } } } -- 2.39.2