Skip to content

Commit 986a277

Browse files
committed
tweak(challenge): Increase max number of general's challenge entry points to 32
1 parent a8f6955 commit 986a277

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

GeneralsMD/Code/GameEngine/Include/GameClient/ChallengeGenerals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
// DEFINES ////////////////////////////////////////////////////////////////////////////////////////
4141
//static const Int NUM_GENERALS = 12; // ChallengeMenu.wnd dependent
42-
#define NUM_GENERALS (12)
42+
#define NUM_GENERALS (32) // TheSuperHackers @tweak DayV 21/09/2025 Increase number of challenge generals.
4343

4444
// FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
4545

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ChallengeMenu.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ void setEnabledButtons()
144144
{
145145
for (Int i = 0; i < NUM_GENERALS; i++)
146146
{
147+
if (!buttonGeneralPosition[i]) // TheSuperHackers @tweak DayV 21/09/2025 Increase number of challenge generals.
148+
continue;
147149
const GeneralPersona* generals = TheChallengeGenerals->getChallengeGenerals();
148150
buttonGeneralPosition[i]->winEnable(generals[i].isStartingEnabled());
149151
buttonGeneralPosition[i]->winHide(! generals[i].isStartingEnabled());
@@ -238,7 +240,8 @@ void updateButtonSequence(Int stepsPerUpdate)
238240
{
239241
// selected look
240242
Int pos = buttonSequenceStep;
241-
if (pos < NUM_GENERALS && !buttonGeneralPosition[pos]->winIsHidden())
243+
// TheSuperHackers @tweak DayV 21/09/2025 Increase number of challenge generals.
244+
if (pos < NUM_GENERALS && buttonGeneralPosition[pos] && !buttonGeneralPosition[pos]->winIsHidden())
242245
{
243246
Int templateNum = ThePlayerTemplateStore->getTemplateNumByName(generals[pos].getPlayerTemplateName());
244247
const PlayerTemplate *playerTemplate = ThePlayerTemplateStore->getNthPlayerTemplate(templateNum);
@@ -247,7 +250,7 @@ void updateButtonSequence(Int stepsPerUpdate)
247250
}
248251

249252
// mouseover look
250-
if (--pos > 0 && pos < NUM_GENERALS && !buttonGeneralPosition[pos]->winIsHidden())
253+
if (--pos > 0 && pos < NUM_GENERALS && buttonGeneralPosition[pos] && !buttonGeneralPosition[pos]->winIsHidden())
251254
{
252255
Int templateNum = ThePlayerTemplateStore->getTemplateNumByName(generals[pos].getPlayerTemplateName());
253256
const PlayerTemplate *playerTemplate = ThePlayerTemplateStore->getNthPlayerTemplate(templateNum);
@@ -256,7 +259,7 @@ void updateButtonSequence(Int stepsPerUpdate)
256259
}
257260

258261
// regular look
259-
if (--pos > 0 && pos < NUM_GENERALS && !buttonGeneralPosition[pos]->winIsHidden())
262+
if (--pos > 0 && pos < NUM_GENERALS && buttonGeneralPosition[pos] && !buttonGeneralPosition[pos]->winIsHidden())
260263
{
261264
Int templateNum = ThePlayerTemplateStore->getTemplateNumByName(generals[pos].getPlayerTemplateName());
262265
const PlayerTemplate *playerTemplate = ThePlayerTemplateStore->getNthPlayerTemplate(templateNum);
@@ -365,10 +368,10 @@ void ChallengeMenuInit( WindowLayout *layout, void *userData )
365368
strButtonName.format("ChallengeMenu.wnd:GeneralPosition%d", i);
366369
buttonGeneralPositionID[i] = TheNameKeyGenerator->nameToKey( strButtonName );
367370
buttonGeneralPosition[i] = TheWindowManager->winGetWindowFromId( parentMenu, buttonGeneralPositionID[i] );
368-
DEBUG_ASSERTCRASH(buttonGeneralPosition[i], ("Could not find the ButtonGeneralPosition[%d]",i ));
369-
370-
// start all buttons hidden, then expose them later if there is a general for this spot
371-
buttonGeneralPosition[i]->winHide( TRUE );
371+
// TheSuperHackers @tweak DayV 21/09/2025 Increase number of challenge generals.
372+
if (buttonGeneralPosition[i])
373+
// start all buttons hidden, then expose them later if there is a general for this spot
374+
buttonGeneralPosition[i]->winHide( TRUE );
372375
}
373376

374377
// set defaults

0 commit comments

Comments
 (0)