From 3564bfae08bf9ec93f735f3d0c49e59c4cc96101 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Sat, 11 Apr 2026 23:59:38 +0200 Subject: [PATCH 1/2] bugfix(money): Fix undefined behavior for starting cash combo box. --- GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp index 0df5ca5a057..b62a6937e4a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp @@ -334,8 +334,7 @@ void PopulateStartingCashComboBox(GameWindow *comboBox, GameInfo *myGame) const MultiplayerStartingMoneyList & startingCashMap = TheMultiplayerSettings->getStartingMoneyList(); Int currentSelectionIndex = -1; - MultiplayerStartingMoneyList::const_iterator it = startingCashMap.begin(); - for ( ; it != startingCashMap.end(); it++ ) + for (MultiplayerStartingMoneyList::const_iterator it = startingCashMap.begin(); it != startingCashMap.end(); it++ ) { Int newIndex = GadgetComboBoxAddEntry(comboBox, formatMoneyForStartingCashComboBox( *it ), comboBox->winGetEnabled() ? comboBox->winGetEnabledTextColor() : comboBox->winGetDisabledTextColor()); @@ -352,7 +351,7 @@ void PopulateStartingCashComboBox(GameWindow *comboBox, GameInfo *myGame) DEBUG_CRASH( ("Current selection for starting cash not found in list") ); currentSelectionIndex = GadgetComboBoxAddEntry(comboBox, formatMoneyForStartingCashComboBox( myGame->getStartingCash() ), comboBox->winGetEnabled() ? comboBox->winGetEnabledTextColor() : comboBox->winGetDisabledTextColor()); - GadgetComboBoxSetItemData(comboBox, currentSelectionIndex, (void *)it->countMoney() ); + GadgetComboBoxSetItemData(comboBox, currentSelectionIndex, (void *)myGame->getStartingCash().countMoney() ); } GadgetComboBoxSetSelectedPos(comboBox, currentSelectionIndex); From baabf9b22236c66ecdea607b77f9b06d9ee373ff Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Sun, 12 Apr 2026 03:04:09 +0200 Subject: [PATCH 2/2] Removed unused function declaration in Generals. --- Generals/Code/GameEngine/Include/GameNetwork/GUIUtil.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Generals/Code/GameEngine/Include/GameNetwork/GUIUtil.h b/Generals/Code/GameEngine/Include/GameNetwork/GUIUtil.h index 862270b69a8..e3549ab2344 100644 --- a/Generals/Code/GameEngine/Include/GameNetwork/GUIUtil.h +++ b/Generals/Code/GameEngine/Include/GameNetwork/GUIUtil.h @@ -36,7 +36,6 @@ void ShowUnderlyingGUIElements( Bool show, const char *layoutFilename, const cha void PopulateColorComboBox(Int comboBox, GameWindow *comboArray[], GameInfo *myGame, Bool isObserver = FALSE); void PopulatePlayerTemplateComboBox(Int comboBox, GameWindow *comboArray[], GameInfo *myGame, Bool allowObservers ); void PopulateTeamComboBox(Int comboBox, GameWindow *comboArray[], GameInfo *myGame, Bool isObserver = FALSE); -void PopulateStartingCashComboBox(GameWindow *comboBox, GameInfo *myGame); void EnableSlotListUpdates( Bool val ); Bool AreSlotListUpdatesEnabled();