From 998f92ea1c156a8136415b221b16804de0a59187 Mon Sep 17 00:00:00 2001 From: MrS-ibra Date: Sat, 24 Jan 2026 17:47:00 +0300 Subject: [PATCH] Fix duplicate start position assignment in populateRandomStartPosition --- .../GameEngine/Source/GameLogic/System/GameLogic.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp index bfd91242f0..66b3407c2d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp @@ -912,10 +912,18 @@ static void populateRandomStartPosition(GameInfo* game) continue; Int posIdx = slot->getStartPos(); - if (posIdx >= 0 || posIdx >= numPlayers) + if (posIdx >= 0 && posIdx < numPlayers) { + if (taken[posIdx]) + { + // Duplicate explicit start position: mark as random so it gets reassigned + slot->setStartPos(-1); + } + else + { hasStartSpotBeenPicked = TRUE; taken[posIdx] = TRUE; + } } }