mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
fix modifications (by tech or aura) of garrison and formation auras, fixes #3799, patch by fatherbushido
This was SVN commit r17863.
This commit is contained in:
parent
18829e17c2
commit
2546eecbf3
1 changed files with 8 additions and 0 deletions
|
|
@ -213,12 +213,17 @@ Auras.prototype.Clean = function()
|
|||
{
|
||||
var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|
||||
var auraNames = this.GetAuraNames();
|
||||
let targetUnitsClone = {};
|
||||
// remove all bonuses
|
||||
for (let name of auraNames)
|
||||
{
|
||||
targetUnitsClone[name] = [];
|
||||
if (!this[name])
|
||||
continue;
|
||||
|
||||
if (this[name].targetUnits)
|
||||
targetUnitsClone[name] = this[name].targetUnits.slice();
|
||||
|
||||
if (this.IsGlobalAura(name))
|
||||
this.RemoveTemplateBonus(name);
|
||||
|
||||
|
|
@ -261,7 +266,10 @@ Auras.prototype.Clean = function()
|
|||
continue;
|
||||
|
||||
if (!this.IsRangeAura(name))
|
||||
{
|
||||
this.ApplyBonus(name, targetUnitsClone[name]);
|
||||
continue;
|
||||
}
|
||||
|
||||
this[name].rangeQuery = cmpRangeManager.CreateActiveQuery(
|
||||
this.entity,
|
||||
|
|
|
|||
Loading…
Reference in a new issue