Ticket #3799: 3799.2.diff
File 3799.2.diff, 1.8 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Auras.js
Auras.prototype.IsGlobalAura = function( 215 215 */ 216 216 Auras.prototype.Clean = function() 217 217 { 218 218 var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); 219 219 var auraNames = this.GetAuraNames(); 220 let targetUnitsClone = {}; 220 221 // remove all bonuses 221 222 for (let name of auraNames) 222 223 { 224 targetUnitsClone[name] = []; 223 225 if (!this[name]) 224 226 continue; 225 227 228 targetUnitsClone[name] = this[name].targetUnits.slice(0); 226 229 if (this.IsGlobalAura(name)) 227 230 this.RemoveTemplateBonus(name); 228 231 229 232 this.RemoveBonus(name, this[name].targetUnits); 230 233 … … Auras.prototype.Clean = function() 263 266 264 267 if (!affectedPlayers.length) 265 268 continue; 266 269 267 270 if (!this.IsRangeAura(name)) 271 { 272 this.ApplyBonus(name, targetUnitsClone[name]); 268 273 continue; 274 } 269 275 270 276 this[name].rangeQuery = cmpRangeManager.CreateActiveQuery( 271 277 this.entity, 272 278 0, 273 279 this.GetRange(name), … … Auras.prototype.Clean = function() 277 283 ); 278 284 cmpRangeManager.EnableActiveQuery(this[name].rangeQuery); 279 285 280 286 if (this.IsGlobalAura(name)) 281 287 { 282 // update stats in for all templates 288 // update stats in for all templates 283 289 this.ApplyTemplateBonus(name, affectedPlayers); 284 290 // 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": [] }); 286 292 } 287 293 } 288 294 }; 289 295 290 296 Auras.prototype.GiveMembersWithValidClass = function(auraName, entityList)