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:
mimo 2016-03-10 21:46:37 +00:00
parent 18829e17c2
commit 2546eecbf3

View file

@ -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,