]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot waypoints: allow to lock the currently aimed waypoint with the use key (keeping...
authorterencehill <piuntn@gmail.com>
Mon, 5 Nov 2018 15:19:55 +0000 (16:19 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 5 Nov 2018 21:32:00 +0000 (22:32 +0100)
qcsrc/server/bot/default/waypoints.qc
qcsrc/server/bot/default/waypoints.qh

index a4fdfcab3902420e150ca700f254210cf5eba48a..65a75e304b6d575026aecc9a4a121301fe20d51b 100644 (file)
@@ -1428,10 +1428,14 @@ void botframe_showwaypointlinks()
        FOREACH_CLIENT(IS_PLAYER(it) && !it.isbot,
        {
                int display_type = 0;
-               entity head = navigation_findnearestwaypoint(it, false);
+               if (PHYS_INPUT_BUTTON_USE(it))
+                       it.wp_locked = it.wp_aimed;
+               entity head = it.wp_locked;
+               if (!head)
+                       head = navigation_findnearestwaypoint(it, false);
                it.nearestwaypoint = head; // mainly useful for debug
                it.nearestwaypointtimeout = time + 2; // while I'm at it...
-               if (IS_ONGROUND(it) || it.waterlevel > WATERLEVEL_NONE)
+               if (IS_ONGROUND(it) || it.waterlevel > WATERLEVEL_NONE || it.wp_locked)
                        display_type = 1; // default
                else if(head && (head.wphardwired))
                        display_type = 2; // only hardwired
index e661c672d019ab4ad2aeeea5484dcca621c2a5a7..0b69dcbb8bca3e80fa9d543c5fcab6305e1f3b8c 100644 (file)
@@ -29,6 +29,7 @@ float botframe_cachedwaypointlinks;
 .float wpfire, wpcost, wpconsidered, wpisbox, wplinked, wphardwired;
 .int wpflags;
 .entity wp_aimed;
+.entity wp_locked;
 
 .vector wpnearestpoint;