Ticket #3799: 3799.4.diff

File 3799.4.diff, 1.3 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        if (this[name].targetUnits)
     225            targetUnitsClone[name] = this[name].targetUnits.slice();
     226
    222227        if (this.IsGlobalAura(name))
    223228            this.RemoveTemplateBonus(name);
    224229
    225230        this.RemoveBonus(name, this[name].targetUnits);
    226231
    Auras.prototype.Clean = function()  
    256261        this[name] = {};
    257262        this[name].targetUnits = [];
    258263        var affectedPlayers = this.GetAffectedPlayers(name);
    259264
    260265        if (!affectedPlayers.length)
     266        {
     267            this.ApplyBonus(name, targetUnitsClone[name]);
    261268            continue;
     269        }
    262270
    263271        if (!this.IsRangeAura(name))
    264272            continue;
    265273
    266274        this[name].rangeQuery = cmpRangeManager.CreateActiveQuery(