Allow to set the biome with the autostart command.

Basically a patch by: @wraitii
Differential revision: https://code.wildfiregames.com/D4976
Comments by: @bb, @sera
Accepted by: @Langbart
Fixes #6521

This was SVN commit r27692.
This commit is contained in:
Freagarach
2023-06-14 06:35:27 +00:00
parent f64b3f773e
commit 5893c4bc85
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -8,6 +8,7 @@ Basic gameplay:
Autostart:
-autostart="TYPEDIR/MAPNAME" enables autostart and sets MAPNAME; TYPEDIR is skirmishes, scenarios, or random
-autostart-biome=BIOME sets BIOME for a random map
-autostart-seed=SEED sets randomization seed value (default 0, use -1 for random)
-autostart-ai=PLAYER:AI sets the AI for PLAYER (e.g. 2:petra)
-autostart-aidiff=PLAYER:DIFF sets the DIFFiculty of PLAYER's AI (default 3, 0: sandbox, 5: very hard)
+7
View File
@@ -800,6 +800,7 @@ CParamNode GetTemplate(const std::string& templateName)
*
* -autostart="TYPEDIR/MAPNAME" enables autostart and sets MAPNAME;
* TYPEDIR is skirmishes, scenarios, or random
* -autostart-biome=BIOME sets BIOME for a random map
* -autostart-seed=SEED sets randomization seed value (default 0, use -1 for random)
* -autostart-ai=PLAYER:AI sets the AI for PLAYER (e.g. 2:petra)
* -autostart-aidiff=PLAYER:DIFF sets the DIFFiculty of PLAYER's AI
@@ -958,6 +959,12 @@ bool Autostart(const CmdLineArgs& args)
Script::SetProperty(rq, settings, "Size", mapSize); // Random map size (in patches)
if (args.Has("autostart-biome"))
{
CStr biome = args.Get("autostart-biome");
Script::SetProperty(rq, settings, "Biome", biome);
}
// Get optional number of players (default 2)
size_t numPlayers = 2;
if (args.Has("autostart-players"))