Ticket #3799: 3799.2.diff

File 3799.2.diff, 1.8 KB (added by fatherbushido, 8 years ago)
  • 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()  
    263266
    264267        if (!affectedPlayers.length)
    265268            continue;
    266269
    267270        if (!this.IsRangeAura(name))
     271        {
     272            this.ApplyBonus(name, targetUnitsClone[name]);
    268273            continue;
     274        }
    269275
    270276        this[name].rangeQuery = cmpRangeManager.CreateActiveQuery(
    271277            this.entity,
    272278            0,
    273279            this.GetRange(name),
    Auras.prototype.Clean = function()  
    277283        );
    278284        cmpRangeManager.EnableActiveQuery(this[name].rangeQuery);
    279285
    280286        if (this.IsGlobalAura(name))
    281287        {
    282             // update stats in for all templates 
     288            // update stats in for all templates
    283289            this.ApplyTemplateBonus(name, affectedPlayers);
    284290            // Add self to your own query for consistency with templates.
    285             this.OnRangeUpdate({"tag":this[name].rangeQuery, "added":[this.entity], "removed":[]});
     291            this.OnRangeUpdate({ "tag": this[name].rangeQuery, "added": [this.entity], "removed": [] });
    286292        }
    287293    }
    288294};
    289295
    290296Auras.prototype.GiveMembersWithValidClass = function(auraName, entityList)