1
0
forked from 0ad/0ad

Add a ceasire autostart option, silences a javascript warning on autostart games

fixes #4606

This was SVN commit r21561.
This commit is contained in:
bb 2018-03-16 00:12:58 +00:00
parent 648cd44576
commit 7127186b70
2 changed files with 8 additions and 0 deletions

View File

@ -14,6 +14,7 @@ Autostart:
-autostart-aiseed=AISEED sets the seed used for the AI random generator (default 0, use -1 for random)
-autostart-civ=PLAYER:CIV sets PLAYER's civilisation to CIV (skirmish and random maps only)
-autostart-team=PLAYER:TEAM sets the team for PLAYER (e.g. 2:2).
-autostart-ceasefire=NUM sets a ceasefire duration NUM (default 0 minutes)
-autostart-nonvisual disable any graphics and sounds
-autostart-victory=SCRIPTNAME sets the victory conditions with SCRIPTNAME located in simulation/data/settings/victory_conditions/
-autostart-wonderduration=NUM sets the victory duration NUM for wonder victory condition (default 10 minutes)

View File

@ -1152,6 +1152,8 @@ CStr8 LoadSettingsOfScenarioMap(const VfsPath &mapPath)
* -autostart-civ=PLAYER:CIV sets PLAYER's civilisation to CIV
* (skirmish and random maps only)
* -autostart-team=PLAYER:TEAM sets the team for PLAYER (e.g. 2:2).
* -autostart-ceasefire=NUM sets a ceasefire duration NUM
* (default 0 minutes)
* -autostart-nonvisual disable any graphics and sounds
* -autostart-victory=SCRIPTNAME sets the victory conditions with SCRIPTNAME
* located in simulation/data/settings/victory_conditions/
@ -1350,6 +1352,11 @@ bool Autostart(const CmdLineArgs& args)
}
}
int ceasefire = 0;
if (args.Has("autostart-ceasefire"))
ceasefire = args.Get("autostart-ceasefire").ToInt();
scriptInterface.SetProperty(settings, "Ceasefire", ceasefire);
if (args.Has("autostart-ai"))
{
std::vector<CStr> aiArgs = args.GetMultiple("autostart-ai");