From 65aa7c910e1e4a3ef7b39bf4ac4b0f325af7ccf1 Mon Sep 17 00:00:00 2001 From: AwfulRanger <10349312+AwfulRanger@users.noreply.github.com> Date: Wed, 26 Feb 2025 23:39:32 -0500 Subject: [PATCH] Fix engineer bots softlocking on ctf --- .../tf_bot_engineer_build_teleport_entrance.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/game/server/tf/bot/behavior/engineer/tf_bot_engineer_build_teleport_entrance.cpp b/src/game/server/tf/bot/behavior/engineer/tf_bot_engineer_build_teleport_entrance.cpp index c6924aa99..fa16adf99 100644 --- a/src/game/server/tf/bot/behavior/engineer/tf_bot_engineer_build_teleport_entrance.cpp +++ b/src/game/server/tf/bot/behavior/engineer/tf_bot_engineer_build_teleport_entrance.cpp @@ -29,7 +29,8 @@ ActionResult< CTFBot > CTFBotEngineerBuildTeleportEntrance::OnStart( CTFBot *me, ActionResult< CTFBot > CTFBotEngineerBuildTeleportEntrance::Update( CTFBot *me, float interval ) { CTeamControlPoint *point = me->GetMyControlPoint(); - if ( !point ) + CCaptureZone *zone = me->GetFlagCaptureZone(); + if ( !point && !zone ) { // wait until a control point becomes available return Continue(); @@ -64,7 +65,14 @@ ActionResult< CTFBot > CTFBotEngineerBuildTeleportEntrance::Update( CTFBot *me, if ( !m_path.IsValid() ) { CTFBotPathCost cost( me, FASTEST_ROUTE ); - m_path.Compute( me, point->GetAbsOrigin(), cost ); + if ( point ) + { + m_path.Compute( me, point->GetAbsOrigin(), cost ); + } + else if ( zone ) + { + m_path.Compute( me, zone->WorldSpaceCenter(), cost ); + } } m_path.Update( me );