Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/GarrisonHolder.js
Show First 20 Lines • Show All 443 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
return this.PerformEject([entity], forced); | return this.PerformEject([entity], forced); | ||||
}; | }; | ||||
/** | /** | ||||
* Unload one or all units that match a template and owner from | * Unload one or all units that match a template and owner from | ||||
* the garrisoning entity and order them to move to the Rally Point | * the garrisoning entity and order them to move to the Rally Point | ||||
* Returns true if successful, false if not | * Returns true if successful, false if not | ||||
* | |||||
* extendedTemplate has the format "p"+ownerid+"&"+template | |||||
*/ | */ | ||||
GarrisonHolder.prototype.UnloadTemplate = function(extendedTemplate, all, forced) | GarrisonHolder.prototype.UnloadTemplate = function(template, owner, all, forced) | ||||
{ | { | ||||
var index = extendedTemplate.indexOf("&"); | |||||
if (index == -1) | |||||
return false; | |||||
var owner = +extendedTemplate.slice(1,index); | |||||
var template = extendedTemplate.slice(index+1); | |||||
var entities = []; | var entities = []; | ||||
var cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager); | var cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager); | ||||
for (var entity of this.entities) | for (var entity of this.entities) | ||||
{ | { | ||||
var cmpIdentity = Engine.QueryInterface(entity, IID_Identity); | var cmpIdentity = Engine.QueryInterface(entity, IID_Identity); | ||||
// Units with multiple ranks are grouped together. | // Units with multiple ranks are grouped together. | ||||
var name = cmpIdentity.GetSelectionGroupName() | var name = cmpIdentity.GetSelectionGroupName() | ||||
▲ Show 20 Lines • Show All 274 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator