Index: binaries/data/mods/public/simulation/components/Fogging.js =================================================================== --- binaries/data/mods/public/simulation/components/Fogging.js +++ binaries/data/mods/public/simulation/components/Fogging.js @@ -192,23 +192,22 @@ return; let cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); - for (let player in this.mirages) - { - if (this.mirages[player] == INVALID_ENTITY) + this.mirages.forEach((mirage, player) => { + if (mirage == INVALID_ENTITY) continue; // When this.entity is in the line of sight of the player, its mirage is hidden, rather than destroyed, to save on performance. // All hidden mirages can be destroyed now (they won't be needed again), and other mirages will destroy themselves when they get out of the fog. - if (cmpRangeManager.GetLosVisibility(this.mirages[player], player) == "hidden") + if (cmpRangeManager.GetLosVisibility(mirage, player) == "hidden") { - Engine.DestroyEntity(this.mirages[player]); + Engine.DestroyEntity(mirage); continue; } - let cmpMirage = Engine.QueryInterface(this.mirages[player], IID_Mirage); + let cmpMirage = Engine.QueryInterface(mirage, IID_Mirage); if (cmpMirage) cmpMirage.SetParent(INVALID_ENTITY); - } + }); }; Fogging.prototype.OnVisibilityChanged = function(msg)