]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot waypoints: add "wpeditor lock" command that replaces the usage of the 'use' butto...
authorterencehill <piuntn@gmail.com>
Fri, 9 Aug 2019 14:26:56 +0000 (16:26 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 9 Aug 2019 14:26:56 +0000 (16:26 +0200)
qcsrc/server/bot/default/waypoints.qc
qcsrc/server/command/cmd.qc

index 84def4a8fbd099f9c6d0809f7e7cce4295271f10..0b06a9593c4afe46d04a4620735ac71ab3dc8651 100644 (file)
@@ -260,6 +260,13 @@ vector waypoint_getSymmetricalPoint(vector org, int ctf_flags)
        return new_org;
 }
 
+void crosshair_trace_waypoints(entity pl);
+void waypoint_lock(entity pl)
+{
+       crosshair_trace_waypoints(pl);
+       pl.wp_locked = trace_ent;
+}
+
 bool waypoint_has_hardwiredlinks(entity wp)
 {
        if (!wp)
@@ -504,7 +511,6 @@ void waypoint_clear_start_wp_globals(entity pl, bool warn)
                LOG_INFO("^xf80Start waypoint has been cleared.\n");
 }
 
-void crosshair_trace_waypoints(entity pl);
 void waypoint_start_hardwiredlink(entity pl, bool at_crosshair)
 {
        entity wp = pl.nearestwaypoint;
@@ -2087,8 +2093,6 @@ void botframe_showwaypointlinks()
                        it.wp_aimed = NULL;
                if (wasfreed(it.wp_locked))
                        it.wp_locked = NULL;
-               if (PHYS_INPUT_BUTTON_USE(it))
-                       it.wp_locked = it.wp_aimed;
                entity head = it.wp_locked;
                if (!head)
                        head = navigation_findnearestwaypoint(it, false);
index ea4cb9022630f463e220eea1808800a640f53203..39c2190bf299969f251f5a8c5e65bdc2b854348c 100644 (file)
@@ -205,6 +205,11 @@ void ClientCommand_wpeditor(entity caller, int request, int argc)
                                        waypoint_start_hardwiredlink(caller, (s == "crosshair"));
                                        return;
                                }
+                               else if (argv(1) == "lock")
+                               {
+                                       waypoint_lock(caller);
+                                       return;
+                               }
                                else if (argv(1) == "unreachable")
                                {
                                        if (!IS_PLAYER(caller))
@@ -259,6 +264,7 @@ void ClientCommand_wpeditor(entity caller, int request, int argc)
                        sprint(caller, "   ^5spawn support^7: spawns a support waypoint (spawn another waypoint to create destination from which all incoming links are removed), useful to replace links to preblematic jumppad/teleport waypoints\n");
                        sprint(caller, "   ^5hardwire^7: marks the nearest waypoint as origin of a new hardwired link (spawn another waypoint over an existing one to create destination)\n");
                        sprint(caller, "   ^5hardwire crosshair^7: marks the waypoint at crosshair instead of the nearest waypoint\n");
+                       sprint(caller, "   ^5lock^7: locks link display of the aimed waypoint (unlocks if no waypoint is found at crosshair's position)\n");
                        sprint(caller, "   ^5symorigin get|set\n");
                        sprint(caller, "   ^5symorigin get|set p1 p2 ... pX\n");
                        sprint(caller, "   ^5symaxis get|set p1 p2\n");