From 5d2a81f341fa4e411bb1390b2eb37fb81359d293 Mon Sep 17 00:00:00 2001 From: dmitry Date: Sat, 12 Feb 2022 23:22:54 +0300 Subject: [PATCH] fix: make bots reach the debug goal node. --- src/botlib.cpp | 13 ++----------- src/navigate.cpp | 3 +++ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/botlib.cpp b/src/botlib.cpp index e373cf4..088a622 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -3054,18 +3054,9 @@ void Bot::normal_ () { // user forced a waypoint as a goal? if (debugGoal != kInvalidNodeIndex && getTask ()->data != debugGoal) { clearSearchNodes (); + getTask ()->data = debugGoal; - } - - // stand still if reached debug goal - else if (m_currentNodeIndex == debugGoal) { - pev->button = 0; - ignoreCollision (); - - m_moveSpeed = 0.0; - m_strafeSpeed = 0.0f; - - return; + m_chosenGoalIndex = debugGoal; } // bots rushing with knife, when have no enemy (thanks for idea to nicebot project) diff --git a/src/navigate.cpp b/src/navigate.cpp index 04bbb6a..f9fc261 100644 --- a/src/navigate.cpp +++ b/src/navigate.cpp @@ -823,6 +823,9 @@ bool Bot::updateNavigation () { else if (m_currentTravelFlags & PathFlag::Jump) { desiredDistance = 0.0f; } + else if (m_path->number == cv_debug_goal.int_ ()) { + desiredDistance = 0.0f; + } else { desiredDistance = m_path->radius; }