Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Commands.js
Context not available. | |||||
entities.push(ent); | entities.push(ent); | ||||
} | } | ||||
var ids = [ id for (id in members) ]; | return { "entities": entities, "members": members }; | ||||
return { "entities": entities, "members": members, "ids": ids }; | |||||
} | } | ||||
/** | /** | ||||
Context not available. | |||||
var formation = ExtractFormations(formedEnts); | var formation = ExtractFormations(formedEnts); | ||||
var formationUnitAIs = []; | var formationUnitAIs = []; | ||||
if (formation.ids.length == 1) | let formationIds = Object.keys(formation.members); | ||||
if (formationIds.length == 1) | |||||
{ | { | ||||
// Selected units either belong to this formation or have no formation | // Selected units either belong to this formation or have no formation | ||||
// Check that all its members are selected | // Check that all its members are selected | ||||
var fid = formation.ids[0]; | var fid = formationIds[0]; | ||||
var cmpFormation = Engine.QueryInterface(+fid, IID_Formation); | var cmpFormation = Engine.QueryInterface(+fid, IID_Formation); | ||||
if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length | if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length | ||||
&& cmpFormation.GetMemberCount() == formation.entities.length) | && cmpFormation.GetMemberCount() == formation.entities.length) | ||||
Context not available. |
Wildfire Games · Phabricator