Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(gamelogic): close the victory banner when the game is cleared

Olcay Seygan5c7ce42fa8ec
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp
index 945a44729..ac0e4c6a0 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp
@@ -203,12 +203,18 @@ void ScriptActions::closeWindows( Bool suppressNewWindows )
m_suppressNewWindows = suppressNewWindows;
// the window is the client's: after the tick, in order with the one doVictory opens
- LogicThread::callAfterTick( []{
+ auto close = []{
if (m_messageWindow) {
TheWindowManager->winDestroy(m_messageWindow);
m_messageWindow = NULL;
}
- } );
+ };
+ // except while the game is cleared: that tick runs on the main thread and GameEngine::reset
+ // discards what it queued, which left the victory banner over the shell
+ if (TheGameLogic->isClearingGameData())
+ close();
+ else
+ LogicThread::callAfterTick( close );
}
//-------------------------------------------------------------------------------------------------