From 0de530b82d9cec9b6aebafe08241db2338356887 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 3 May 2018 11:00:18 +0200 Subject: [PATCH] Bot waypoints: spawn only one destination waypoint for teleports teleporting player to the exact same spot; it fixes links in the map cleftvillage1 --- qcsrc/server/bot/default/waypoints.qc | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); -- 2.39.2