Skip to content

Commit 32a2789

Browse files
authored
tweak(pathfinder): Add audio event and message to announce pathfinding failover (TheSuperHackers#2242)
1 parent b0a6652 commit 32a2789

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
#include "GameLogic/PartitionManager.h"
5050
#include "GameLogic/TerrainLogic.h"
5151
#include "GameLogic/Weapon.h"
52+
#if RETAIL_COMPATIBLE_PATHFINDING
53+
#include "GameClient/InGameUI.h"
54+
#include "GameClient/GameText.h"
55+
#include "Common/GameAudio.h"
56+
#include "Common/MiscAudio.h"
57+
#endif
5258

5359
#include "Common/UnitTimings.h" //Contains the DO_UNIT_TIMINGS define jba.
5460

@@ -1105,6 +1111,11 @@ void PathfindCellInfo::forceCleanPathFindCellInfos()
11051111

11061112
void Pathfinder::forceCleanCells()
11071113
{
1114+
UnicodeString pathfinderFailoverMessage = TheGameText->FETCH_OR_SUBSTITUTE("GUI:PathfindingCrashPrevented", L"A pathfinding crash was prevented, now switching to the crash fixed pathfinding.");
1115+
TheInGameUI->message(pathfinderFailoverMessage);
1116+
1117+
TheAudio->addAudioEvent(&TheAudio->getMiscAudio()->m_allCheerSound);
1118+
11081119
PathfindCellInfo::forceCleanPathFindCellInfos();
11091120
m_openList = nullptr;
11101121
m_closedList = nullptr;

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
#include "GameLogic/PartitionManager.h"
5050
#include "GameLogic/TerrainLogic.h"
5151
#include "GameLogic/Weapon.h"
52+
#if RETAIL_COMPATIBLE_PATHFINDING
53+
#include "GameClient/InGameUI.h"
54+
#include "GameClient/GameText.h"
55+
#include "Common/GameAudio.h"
56+
#include "Common/MiscAudio.h"
57+
#endif
5258

5359
#include "Common/UnitTimings.h" //Contains the DO_UNIT_TIMINGS define jba.
5460

@@ -1120,6 +1126,11 @@ void PathfindCellInfo::forceCleanPathFindCellInfos()
11201126

11211127
void Pathfinder::forceCleanCells()
11221128
{
1129+
UnicodeString pathfinderFailoverMessage = TheGameText->FETCH_OR_SUBSTITUTE("GUI:PathfindingCrashPrevented", L"A pathfinding crash was prevented, now switching to the crash fixed pathfinding.");
1130+
TheInGameUI->message(pathfinderFailoverMessage);
1131+
1132+
TheAudio->addAudioEvent(&TheAudio->getMiscAudio()->m_allCheerSound);
1133+
11231134
PathfindCellInfo::forceCleanPathFindCellInfos();
11241135
m_openList = nullptr;
11251136
m_closedList = nullptr;

0 commit comments

Comments
 (0)