From: terencehill Date: Sat, 13 Oct 2018 14:24:04 +0000 (+0200) Subject: Bot waypoints: try to add another link if the 32th link of a waypoint was removed X-Git-Tag: xonotic-v0.8.5~1742^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b1fc42d90a7bdb4d18f3e5133eeeaec953adf5b4;p=xonotic%2Fxonotic-data.pk3dir.git Bot waypoints: try to add another link if the 32th link of a waypoint was removed --- diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc index a8d953450..c9bfaeeb1 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -358,6 +358,8 @@ void waypoint_removelink(entity from, entity to) if (from == to || (from.wpflags & WAYPOINTFLAG_NORELINK)) return; + entity fromwp31_prev = from.wp31; + bool found = false; if (!found && from.wp00 == to) found = true; if (found) {from.wp00 = from.wp01; from.wp00mincost = from.wp01mincost;} if (!found && from.wp01 == to) found = true; if (found) {from.wp01 = from.wp02; from.wp01mincost = from.wp02mincost;} @@ -391,6 +393,9 @@ void waypoint_removelink(entity from, entity to) if (!found && from.wp29 == to) found = true; if (found) {from.wp29 = from.wp30; from.wp29mincost = from.wp30mincost;} if (!found && from.wp30 == to) found = true; if (found) {from.wp30 = from.wp31; from.wp30mincost = from.wp31mincost;} if (!found && from.wp31 == to) found = true; if (found) {from.wp31 = NULL; from.wp31mincost = 10000000;} + + if (fromwp31_prev && !from.wp31) + waypoint_schedulerelink(from); } bool waypoint_islinked(entity from, entity to)