Ticket #3799: 3799.3.diff

File 3799.3.diff, 1.2 KB (added by fatherbushido, 8 years ago)
  • binaries/data/mods/public/simulation/components/Auras.js

    Auras.prototype.IsGlobalAura = function(  
    211211 */
    212212Auras.prototype.Clean = function()
    213213{
    214214    var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
    215215    var auraNames = this.GetAuraNames();
     216    let targetUnitsClone = {};
    216217    // remove all bonuses
    217218    for (let name of auraNames)
    218219    {
     220        targetUnitsClone[name] = [];
    219221        if (!this[name])
    220222            continue;
    221223
     224        targetUnitsClone[name] = this[name].targetUnits.slice(0);
     225
    222226        if (this.IsGlobalAura(name))
    223227            this.RemoveTemplateBonus(name);
    224228
    225229        this.RemoveBonus(name, this[name].targetUnits);
    226230
    Auras.prototype.Clean = function()  
    256260        this[name] = {};
    257261        this[name].targetUnits = [];
    258262        var affectedPlayers = this.GetAffectedPlayers(name);
    259263
    260264        if (!affectedPlayers.length)
     265        {
     266            this.ApplyBonus(name, targetUnitsClone[name]);
    261267            continue;
     268        }
    262269
    263270        if (!this.IsRangeAura(name))
    264271            continue;
    265272
    266273        this[name].rangeQuery = cmpRangeManager.CreateActiveQuery(