Skip to content

Commit 3c91e33

Browse files
docs(logic): Add info about state of TheGameInfo. Add a todo for a bounds check
1 parent ca2f633 commit 3c91e33

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Generals/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ static void populateRandomStartPosition( GameInfo *game )
846846
continue;
847847

848848
Int posIdx = slot->getStartPos();
849-
if (posIdx >= 0 || posIdx >= numPlayers)
849+
if (posIdx >= 0 || posIdx >= numPlayers) // TheSuperHackers @todo stm 19/12/2025 this is not a proper bounds check
850850
{
851851
hasStartSpotBeenPicked = TRUE;
852852
taken[posIdx] = TRUE;
@@ -1105,6 +1105,7 @@ void GameLogic::startNewGame( Bool saveGame )
11051105
{
11061106
TheGameInfo = TheSkirmishGameInfo;
11071107
}
1108+
// TheSuperHackers @info stm 18/12/2025 TheGameInfo is nullptr when you load a savegame of a regular campaign mission
11081109
}
11091110

11101111
checkForDuplicateColors( TheGameInfo );

GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ static void populateRandomStartPosition( GameInfo *game )
891891
continue;
892892

893893
Int posIdx = slot->getStartPos();
894-
if (posIdx >= 0 || posIdx >= numPlayers)
894+
if (posIdx >= 0 || posIdx >= numPlayers) // TheSuperHackers @todo stm 19/12/2025 this is not a proper bounds check
895895
{
896896
hasStartSpotBeenPicked = TRUE;
897897
taken[posIdx] = TRUE;
@@ -1251,6 +1251,7 @@ void GameLogic::startNewGame( Bool loadingSaveGame )
12511251
{
12521252
TheGameInfo = TheChallengeGameInfo;
12531253
}
1254+
// TheSuperHackers @info stm 18/12/2025 TheGameInfo is nullptr when you load a savegame of a regular campaign mission
12541255
}
12551256

12561257
// On a NEW game, we need to copy the superweapon restrictions from the game info to here

0 commit comments

Comments
 (0)