Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,8 @@ void LanGameOptionsMenuInit( WindowLayout *layout, void *userData )
slot->setNATBehavior(FirewallHelperClass::FIREWALL_TYPE_SIMPLE);
game->setMap( pref.getPreferredMap() );
game->setStartingCash( pref.getStartingCash() );
// TheSuperHackers @bugfix Re-populate starting cash combo box after applying user preferences.
PopulateStartingCashComboBox(comboBoxStartingCash, game);
game->setSuperweaponRestriction( pref.getSuperweaponRestricted() ? 1 : 0 );
AsciiString lowerMap = pref.getPreferredMap();
lowerMap.toLower();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,8 @@ void SkirmishGameOptionsMenuInit( WindowLayout *layout, void *userData )
}

TheSkirmishGameInfo->setStartingCash( prefs.getStartingCash() );
// TheSuperHackers @bugfix Re-populate starting cash combo box after applying user preferences.
PopulateStartingCashComboBox(comboBoxStartingCash, TheSkirmishGameInfo);
TheSkirmishGameInfo->setSuperweaponRestriction( prefs.getSuperweaponRestricted() ? 1 : 0 );

TheSkirmishGameInfo->setMap(prefs.getPreferredMap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,8 @@ void WOLGameSetupMenuInit( WindowLayout *layout, void *userData )
// This should probably be enforced at the gamespy level as well, to prevent exploits.
Int isUsingStats = TheGameSpyGame->getUseStats();
game->setStartingCash( isUsingStats? TheMultiplayerSettings->getDefaultStartingMoney() : customPref.getStartingCash() );
// TheSuperHackers @bugfix Re-populate starting cash combo box after applying user preferences.
PopulateStartingCashComboBox(comboBoxStartingCash, game);
game->setSuperweaponRestriction( isUsingStats? 0 : customPref.getSuperweaponRestricted() ? 1 : 0 );
if (isUsingStats)
game->setOldFactionsOnly( 0 );
Expand Down
3 changes: 2 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ 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() );
// TheSuperHackers @bugfix Fix undefined behavior from dereferencing past-the-end iterator.
GadgetComboBoxSetItemData(comboBox, currentSelectionIndex, (void *)myGame->getStartingCash().countMoney() );
}

GadgetComboBoxSetSelectedPos(comboBox, currentSelectionIndex);
Expand Down