diff --git a/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h b/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h index beb8bec34f..2ca6559ca4 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h @@ -89,7 +89,7 @@ typedef std::map PerUnitFXMap; //------------------------------------------------------------------------------------------------- enum { - MAX_UPGRADE_CAMEO_UPGRADES = 5 + MAX_UPGRADE_CAMEO_UPGRADES = 9 }; //------------------------------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h index e6c0e0aba2..9eb727f3c7 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h @@ -404,7 +404,7 @@ class CommandButton : public Overridable * command context sensitive window in the battle user interface */ //------------------------------------------------------------------------------------------------- enum { MAX_COMMANDS_PER_SET = 32 }; // user interface max is 14 (but internally it's 18 for script only buttons!) -enum { MAX_RIGHT_HUD_UPGRADE_CAMEOS = 5}; +enum { MAX_RIGHT_HUD_UPGRADE_CAMEOS = 9}; enum { MAX_PURCHASE_SCIENCE_RANK_1 = 7, MAX_PURCHASE_SCIENCE_RANK_3 = 21, diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp index 46f03030ce..8a1fa01f8c 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -173,6 +173,10 @@ const FieldParse ThingTemplate::s_objectFieldParseTable[] = { "UpgradeCameo3", INI::parseAsciiString, NULL, offsetof( ThingTemplate, m_upgradeCameoUpgradeNames[ 2 ] ) }, { "UpgradeCameo4", INI::parseAsciiString, NULL, offsetof( ThingTemplate, m_upgradeCameoUpgradeNames[ 3 ] ) }, { "UpgradeCameo5", INI::parseAsciiString, NULL, offsetof( ThingTemplate, m_upgradeCameoUpgradeNames[ 4 ] ) }, + { "UpgradeCameo6", INI::parseAsciiString, NULL, offsetof( ThingTemplate, m_upgradeCameoUpgradeNames[ 5 ] ) }, + { "UpgradeCameo7", INI::parseAsciiString, NULL, offsetof( ThingTemplate, m_upgradeCameoUpgradeNames[ 6 ] ) }, + { "UpgradeCameo8", INI::parseAsciiString, NULL, offsetof( ThingTemplate, m_upgradeCameoUpgradeNames[ 7 ] ) }, + { "UpgradeCameo9", INI::parseAsciiString, NULL, offsetof( ThingTemplate, m_upgradeCameoUpgradeNames[ 8 ] ) }, // NOTE NOTE NOTE -- s_objectFieldParseTable and s_objectReskinFieldParseTable must be updated in tandem -- see comment above diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index c867c3f182..11b60baa4f 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -1204,7 +1204,9 @@ void ControlBar::init( void ) id = TheNameKeyGenerator->nameToKey( windowName.str() ); m_rightHUDUpgradeCameos[ i ] = TheWindowManager->winGetWindowFromId( m_rightHUDWindow, id ); - m_rightHUDUpgradeCameos[ i ]->winSetStatus( WIN_STATUS_USE_OVERLAY_STATES ); + if (m_rightHUDUpgradeCameos[i] != nullptr) { + m_rightHUDUpgradeCameos[i]->winSetStatus(WIN_STATUS_USE_OVERLAY_STATES); + } } // m_transitionHandler = NEW GameWindowTransitionsHandler; @@ -2664,6 +2666,9 @@ void ControlBar::setPortraitByObject( Object *obj ) for(Int i = 0; i < MAX_UPGRADE_CAMEO_UPGRADES; ++i) { + if (m_rightHUDUpgradeCameos[i] == nullptr) + continue; + AsciiString upgradeName = thing->getUpgradeCameoName(i); if(upgradeName.isEmpty()) { @@ -2704,7 +2709,8 @@ void ControlBar::setPortraitByObject( Object *obj ) m_rightHUDWindow->winSetStatus( WIN_STATUS_IMAGE ); m_rightHUDCameoWindow->winClearStatus( WIN_STATUS_IMAGE ); for(Int i = 0; i < MAX_UPGRADE_CAMEO_UPGRADES; ++i) - m_rightHUDUpgradeCameos[i]->winHide(TRUE); + if (m_rightHUDUpgradeCameos[i] != nullptr) + m_rightHUDUpgradeCameos[i]->winHide(TRUE); //Clear any overlay the portrait had on it. GadgetButtonDrawOverlayImage( m_rightHUDCameoWindow, NULL ); diff --git a/GeneralsMD/Code/Main/WinMain.cpp b/GeneralsMD/Code/Main/WinMain.cpp index b4567848a4..41edc34eca 100644 --- a/GeneralsMD/Code/Main/WinMain.cpp +++ b/GeneralsMD/Code/Main/WinMain.cpp @@ -803,9 +803,9 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, Int nCmdShow ) { Int exitcode = 1; -//#ifdef _DEBUG -// WaitForDebugger(); //in debug build, wait for debugger attachment -//#endif +#ifdef _DEBUG + //WaitForDebugger(); //in debug build, wait for debugger attachment +#endif #ifdef RTS_PROFILE Profile::StartRange("init");