Ticket #3799: 3799.diff

File 3799.diff, 1.3 KB (added by fatherbushido, 8 years ago)

/home/titi/3799.diff

  • binaries/data/mods/public/simulation/components/Auras.js

    Auras.prototype.IsGlobalAura = function(  
    215215 */
    216216Auras.prototype.Clean = function()
    217217{
    218218    var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
    219219    var auraNames = this.GetAuraNames();
     220    let targetUnitsClone = {};
    220221    // remove all bonuses
    221222    for (let name of auraNames)
    222223    {
     224        targetUnitsClone[name] = [];
    223225        if (!this[name])
    224226            continue;
    225227
     228        targetUnitsClone[name] = this[name].targetUnits.slice(0);
    226229        if (this.IsGlobalAura(name))
    227230            this.RemoveTemplateBonus(name);
    228231
    229232        this.RemoveBonus(name, this[name].targetUnits);
    230233
    Auras.prototype.Clean = function()  
    262265        var affectedPlayers = this.GetAffectedPlayers(name);
    263266
    264267        if (!affectedPlayers.length)
    265268            continue;
    266269
    267         if (!this.IsRangeAura(name))
    268             continue;
     270        if (this.IsGarrisonedUnitsAura(name) || this.IsGarrisonAura(name) || this.IsFormationAura(name))
     271            this.ApplyBonus(name, targetUnitsClone[name]);
    269272
    270273        this[name].rangeQuery = cmpRangeManager.CreateActiveQuery(
    271274            this.entity,
    272275            0,
    273276            this.GetRange(name),