Differential D681 Diff 5582 ps/trunk/binaries/data/mods/public/simulation/components/GarrisonHolder.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/GarrisonHolder.js
Show First 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | GarrisonHolder.prototype.PerformGarrison = function(entity) | ||||
if (cmpProductionQueue) | if (cmpProductionQueue) | ||||
cmpProductionQueue.PauseProduction(); | cmpProductionQueue.PauseProduction(); | ||||
let cmpAura = Engine.QueryInterface(entity, IID_Auras); | let cmpAura = Engine.QueryInterface(entity, IID_Auras); | ||||
if (cmpAura && cmpAura.HasGarrisonAura()) | if (cmpAura && cmpAura.HasGarrisonAura()) | ||||
cmpAura.ApplyGarrisonBonus(this.entity); | cmpAura.ApplyGarrisonBonus(this.entity); | ||||
Engine.PostMessage(this.entity, MT_GarrisonedUnitsChanged, { "added": [entity], "removed": [] }); | Engine.PostMessage(this.entity, MT_GarrisonedUnitsChanged, { "added": [entity], "removed": [] }); | ||||
let cmpUnitAI = Engine.QueryInterface(entity, IID_UnitAI); | |||||
if (cmpUnitAI && cmpUnitAI.IsUnderAlert()) | |||||
Engine.PostMessage(cmpUnitAI.GetAlertRaiser(), MT_UnitGarrisonedAfterAlert, { | |||||
"holder": this.entity, | |||||
"unit": entity | |||||
}); | |||||
return true; | return true; | ||||
}; | }; | ||||
/** | /** | ||||
* Simply eject the unit from the garrisoning entity without moving it | * Simply eject the unit from the garrisoning entity without moving it | ||||
* @param {number} entity - Id of the entity to be ejected. | * @param {number} entity - Id of the entity to be ejected. | ||||
* @param {boolean} forced - Whether eject is forced (i.e. if building is destroyed). | * @param {boolean} forced - Whether eject is forced (i.e. if building is destroyed). | ||||
* @return {boolean} Whether the entity was ejected. | * @return {boolean} Whether the entity was ejected. | ||||
▲ Show 20 Lines • Show All 443 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator