Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(gameclient): hide start spots on a generated map in the lobby

Olcay Seygan9ced02b79533
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp
index 289e8fa33..4f8df64df 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp
@@ -40,6 +40,7 @@
#include "Common/PlayerTemplate.h"
#include "Common/QuotedPrintable.h"
#include "Common/RandomValue.h"
+#include "Common/RandomMapGenerator.h"
#include "Common/SkirmishBattleHonors.h"
#include "Common/SkirmishPreferences.h"
#include "GameLogic/GameLogic.h"
@@ -884,7 +885,24 @@ void positionStartSpots( GameInfo *myGame, GameWindow *buttonMapStartPositions[]
}
}
}
- positionStartSpots(localMapFname, buttonMapStartPositions, mapWindow);
+ // A generated map shows the shipped map it is made from (Surprise me the unknown map) until the
+ // match loads. Its spots, depots and tech are not that map's, so none is shown and nobody picks
+ // a spot: every seat starts where the map puts it.
+ if (isGeneratedMapPath(localMapFname))
+ {
+ AsciiString templatePath;
+ generatedMapTemplate(localMapFname, templatePath);
+ positionStartSpots(templatePath, buttonMapStartPositions, mapWindow);
+ mapWindow->winSetUserData(NULL);
+ positionAdditionalImages(NULL, mapWindow, TRUE);
+ for (Int i = 0; i < MAX_SLOTS; ++i)
+ {
+ if (buttonMapStartPositions[i] != NULL)
+ buttonMapStartPositions[i]->winHide(TRUE);
+ }
+ return;
+ }
+ positionStartSpots(localMapFname, buttonMapStartPositions, mapWindow);
}
// A start spot draws as the button it is; a taken one then has its dark middle filled with its team's