From 7127186b70a493bf10321cadb95cd61c61e23cd7 Mon Sep 17 00:00:00 2001 From: bb Date: Fri, 16 Mar 2018 00:12:58 +0000 Subject: [PATCH] Add a ceasire autostart option, silences a javascript warning on autostart games fixes #4606 This was SVN commit r21561. --- binaries/system/readme.txt | 1 + source/ps/GameSetup/GameSetup.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/binaries/system/readme.txt b/binaries/system/readme.txt index 778901089e..2f1ff04af4 100644 --- a/binaries/system/readme.txt +++ b/binaries/system/readme.txt @@ -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) diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index afb43617e6..657899ba5e 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -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 aiArgs = args.GetMultiple("autostart-ai");