1
0
forked from 0ad/0ad

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;

Binary file not shown.

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);
}
}