Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/helpers/InitGame.js
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | for (let i = 0; i < settings.PlayerData.length; ++i) | ||||
} | } | ||||
if (settings.PopulationCap) | if (settings.PopulationCap) | ||||
cmpPlayer.SetMaxPopulation(settings.PopulationCap); | cmpPlayer.SetMaxPopulation(settings.PopulationCap); | ||||
} | } | ||||
if (settings.WorldPopulationCap) | if (settings.WorldPopulationCap) | ||||
Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).SetMaxWorldPopulation(settings.WorldPopulationCap); | Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).SetMaxWorldPopulation(settings.WorldPopulationCap); | ||||
// Update the grid with all entities created for the map init. | |||||
Engine.QueryInterface(SYSTEM_ENTITY, IID_Pathfinder).UpdateGrid(); | |||||
// Map or player data (handicap...) dependent initialisations of components (i.e. garrisoned units). | // Map or player data (handicap...) dependent initialisations of components (i.e. garrisoned units). | ||||
Engine.BroadcastMessage(MT_InitGame, {}); | Engine.BroadcastMessage(MT_InitGame, {}); | ||||
cmpAIManager.TryLoadSharedComponent(); | cmpAIManager.TryLoadSharedComponent(); | ||||
cmpAIManager.RunGamestateInit(); | cmpAIManager.RunGamestateInit(); | ||||
} | } | ||||
Engine.RegisterGlobal("PreInitGame", PreInitGame); | Engine.RegisterGlobal("PreInitGame", PreInitGame); | ||||
Engine.RegisterGlobal("InitGame", InitGame); | Engine.RegisterGlobal("InitGame", InitGame); |
Wildfire Games · Phabricator