From 17039524dce8e96950c4a0c79886d03f331fb545 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 7 May 2019 16:37:12 +0300 Subject: [PATCH] Support for 'yb wp clean' to take neareset to local player waypoint if no arguments passed. --- source/interface.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/interface.cpp b/source/interface.cpp index 1ded366..aaa003d 100644 --- a/source/interface.cpp +++ b/source/interface.cpp @@ -373,6 +373,15 @@ int handleBotCommands (edict_t *ent, const char *arg0, const char *arg1, const c } } } + else { + int nearest = waypoints.getEditorNeareset (), totalCleared = 0; + + if (waypoints.exists (nearest)) { + totalCleared += waypoints.removeUselessConnections (nearest); + + engine.print ("Done. Waypoint %d had %d useless paths.", nearest, totalCleared); + } + } } // teleport player to specified waypoint