From 7823384f4af874c7e4483adf6d3f0f48cf6eb817 Mon Sep 17 00:00:00 2001 From: Mauller <26652186+Mauller@users.noreply.github.com> Date: Mon, 2 Feb 2026 19:05:39 +0000 Subject: [PATCH] tweak(pathfinder): Add audio event and message to announce pathfinding failover --- .../GameEngine/Source/GameLogic/AI/AIPathfind.cpp | 11 +++++++++++ .../GameEngine/Source/GameLogic/AI/AIPathfind.cpp | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index 3d610929fce..2d2b1496c07 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -49,6 +49,12 @@ #include "GameLogic/PartitionManager.h" #include "GameLogic/TerrainLogic.h" #include "GameLogic/Weapon.h" +#if RETAIL_COMPATIBLE_PATHFINDING +#include "GameClient/InGameUI.h" +#include "GameClient/GameText.h" +#include "Common/GameAudio.h" +#include "Common/MiscAudio.h" +#endif #include "Common/UnitTimings.h" //Contains the DO_UNIT_TIMINGS define jba. @@ -1105,6 +1111,11 @@ void PathfindCellInfo::forceCleanPathFindCellInfos() void Pathfinder::forceCleanCells() { + UnicodeString pathfinderFailoverMessage = TheGameText->FETCH_OR_SUBSTITUTE("GUI:PathfindingCrashPrevented", L"A pathfinding crash was prevented, now switching to the crash fixed pathfinding."); + TheInGameUI->message(pathfinderFailoverMessage); + + TheAudio->addAudioEvent(&TheAudio->getMiscAudio()->m_allCheerSound); + PathfindCellInfo::forceCleanPathFindCellInfos(); m_openList = nullptr; m_closedList = nullptr; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index bcb614f74df..eb9a4a38e22 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -49,6 +49,12 @@ #include "GameLogic/PartitionManager.h" #include "GameLogic/TerrainLogic.h" #include "GameLogic/Weapon.h" +#if RETAIL_COMPATIBLE_PATHFINDING +#include "GameClient/InGameUI.h" +#include "GameClient/GameText.h" +#include "Common/GameAudio.h" +#include "Common/MiscAudio.h" +#endif #include "Common/UnitTimings.h" //Contains the DO_UNIT_TIMINGS define jba. @@ -1120,6 +1126,11 @@ void PathfindCellInfo::forceCleanPathFindCellInfos() void Pathfinder::forceCleanCells() { + UnicodeString pathfinderFailoverMessage = TheGameText->FETCH_OR_SUBSTITUTE("GUI:PathfindingCrashPrevented", L"A pathfinding crash was prevented, now switching to the crash fixed pathfinding."); + TheInGameUI->message(pathfinderFailoverMessage); + + TheAudio->addAudioEvent(&TheAudio->getMiscAudio()->m_allCheerSound); + PathfindCellInfo::forceCleanPathFindCellInfos(); m_openList = nullptr; m_closedList = nullptr;