Fixes invalid civ check in rmgen.

Removes some default data from the Atlas blank map.
Changes default civ in autostart-random mode.

This was SVN commit r11809.
This commit is contained in:
historic_bruno 2012-05-09 23:06:03 +00:00
parent c8d68f6e0b
commit 1f5f82f375
3 changed files with 8 additions and 6 deletions

View file

@ -468,10 +468,10 @@ function primeSortPlayers(source)
function getStartingEntities(player)
{
var civ = getCivCode(player);
if (!g_CivData[civ] || (g_CivData[civ].SelectableInGameSetup !== undefined && !g_CivData[civ].SelectableInGameSetup) || !g_CivData[civ].StartEntities || !g_CivData[civ].StartEntities.length)
if (!g_CivData[civ] || !g_CivData[civ].StartEntities || !g_CivData[civ].StartEntities.length)
{
warn("Invalid or unimplemented civ '"+civ+"' specified, falling back to 'hele'");
civ = "hele";
warn("Invalid or unimplemented civ '"+civ+"' specified, falling back to 'athen'");
civ = "athen";
}
return g_CivData[civ].StartEntities;

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:51dcf7313ce4101c47a26ed7979fa07defe737082e6aa04bcd48734598c8dc9d
size 1428
oid sha256:76a3bf81567a9af9c9bd03a59638060fc4ea7795e88b9e4a4af221d74135334f
size 1269

View file

@ -1116,7 +1116,9 @@ bool Autostart(const CmdLineArgs& args)
CScriptVal player;
scriptInterface.Eval("({})", player);
scriptInterface.SetProperty(player.get(), "Civ", std::string("hele"));
// We could load player_defaults.json here, but that would complicate the logic
// even more and autostart is only intended for developers anyway
scriptInterface.SetProperty(player.get(), "Civ", std::string("athen"));
scriptInterface.SetPropertyInt(playerData.get(), i, player);
}
}