1
0
forked from 0ad/0ad
0ad/binaries/data/mods/public/simulation/helpers/Setup.js
Ykkrosh 65bcedb9fc Load map descriptions from their XML file.
Add basic hold-fire stance, and use it for some test maps.
Add JSON data container to map XML files, to simplify the interaction
between scripts and maps.
Fix fixed-point printing so it roundtrips safely through map files.
Fix camera startup positions in old-format maps.

This was SVN commit r7844.
2010-08-04 21:15:41 +00:00

18 lines
385 B
JavaScript

function LoadMapSettings(settings)
{
// Default settings for old maps
if (!settings)
settings = {};
if (settings.DefaultStance)
{
for each (var ent in Engine.GetEntitiesWithInterface(IID_UnitAI))
{
var cmpUnitAI = Engine.QueryInterface(ent, IID_UnitAI);
cmpUnitAI.SetStance(settings.DefaultStance);
}
}
}
Engine.RegisterGlobal("LoadMapSettings", LoadMapSettings);