Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/Fogging.js
Show First 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | Fogging.prototype.OnOwnershipChanged = function(msg) | ||||
// Always activate fogging for non-Gaia entities | // Always activate fogging for non-Gaia entities | ||||
if (msg.to > 0) | if (msg.to > 0) | ||||
this.Activate(); | this.Activate(); | ||||
if (msg.to != -1) | if (msg.to != -1) | ||||
return; | return; | ||||
let cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); | let cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); | ||||
for (let player in this.mirages) | for (let player = 0; player < this.mirages.length; ++player) | ||||
{ | { | ||||
if (this.mirages[player] == INVALID_ENTITY) | if (this.mirages[player] == INVALID_ENTITY) | ||||
continue; | continue; | ||||
// When this.entity is in the line of sight of the player, its mirage is hidden, rather than destroyed, to save on performance. | // 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. | // 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(this.mirages[player], player) == "hidden") | ||||
{ | { | ||||
Show All 26 Lines |
Wildfire Games · Phabricator