From: terencehill Date: Thu, 3 May 2018 09:00:18 +0000 (+0200) Subject: Bot waypoints: spawn only one destination waypoint for teleports teleporting player... X-Git-Tag: xonotic-v0.8.5~2153 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0de530b82d9cec9b6aebafe08241db2338356887;p=xonotic%2Fxonotic-data.pk3dir.git Bot waypoints: spawn only one destination waypoint for teleports teleporting player to the exact same spot; it fixes links in the map cleftvillage1 --- diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc index 384f1e7ce..ce7c69305 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -190,6 +190,16 @@ entity waypoint_spawn(vector m1, vector m2, float f) return it; }); } + // spawn only one destination waypoint for teleports teleporting player to the exact same spot + // otherwise links loaded from file would be applied only to the first destination + // waypoint since link format doesn't specify waypoint entities but just positions + if((f & WAYPOINTFLAG_GENERATED) && !(f & WAYPOINTFLAG_NORELINK) && m1 == m2) + { + IL_EACH(g_waypoints, boxesoverlap(m1, m2, it.absmin, it.absmax), + { + return it; + }); + } entity w = new(waypoint); IL_PUSH(g_waypoints, w);