Index: binaries/data/mods/public/simulation/components/StatusBars.js =================================================================== --- binaries/data/mods/public/simulation/components/StatusBars.js +++ binaries/data/mods/public/simulation/components/StatusBars.js @@ -244,33 +244,33 @@ if (!this.enabled) return 0; - let cmpCapturable = QueryMiragedInterface(this.entity, IID_Capturable); + const cmpCapturable = QueryMiragedInterface(this.entity, IID_Capturable); if (!cmpCapturable) return 0; - let cmpOwnership = QueryMiragedInterface(this.entity, IID_Ownership); + const cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership); if (!cmpOwnership) return 0; - let owner = cmpOwnership.GetOwner(); + const owner = cmpOwnership.GetOwner(); if (owner == INVALID_PLAYER) return 0; this.usedPlayerColors = true; - let capturePoints = cmpCapturable.GetCapturePoints(); + const capturePoints = cmpCapturable.GetCapturePoints(); // Size of health bar (in world-space units) - let width = +this.template.BarWidth; - let height = +this.template.BarHeight; + const width = +this.template.BarWidth; + const height = +this.template.BarHeight; // World-space offset from the unit's position - let offset = { "x": 0, "y": +this.template.HeightOffset, "z": 0 }; + const offset = { "x": 0, "y": +this.template.HeightOffset, "z": 0 }; - let setCaptureBarPart = function(playerID, startSize) + const setCaptureBarPart = function(playerID, startSize) { - let c = QueryPlayerIDInterface(playerID).GetDisplayedColor(); - let strColor = (c.r * 255) + " " + (c.g * 255) + " " + (c.b * 255) + " 255"; - let size = width * capturePoints[playerID] / cmpCapturable.GetMaxCapturePoints(); + const c = QueryPlayerIDInterface(playerID).GetDisplayedColor(); + const strColor = (c.r * 255) + " " + (c.g * 255) + " " + (c.b * 255) + " 255"; + const size = width * capturePoints[playerID] / cmpCapturable.GetMaxCapturePoints(); cmpOverlayRenderer.AddSprite( "art/textures/ui/session/icons/capture_bar.png", @@ -285,7 +285,7 @@ // First handle the owner's points, to keep those points on the left for clarity let size = setCaptureBarPart(owner, -width / 2); - for (let i in capturePoints) + for (const i in capturePoints) if (i != owner && capturePoints[i] > 0) size = setCaptureBarPart(i, size); Index: binaries/data/mods/public/simulation/helpers/Player.js =================================================================== --- binaries/data/mods/public/simulation/helpers/Player.js +++ binaries/data/mods/public/simulation/helpers/Player.js @@ -254,9 +254,14 @@ */ function QueryMiragedInterface(ent, iid) { - let cmpMirage = Engine.QueryInterface(ent, IID_Mirage); + const cmpMirage = Engine.QueryInterface(ent, IID_Mirage); if (cmpMirage && !cmpMirage.Mirages(iid)) + { + warn("Attempted to query miraged interface " + iid + ", which does not exist"); + // Print out the stack because the above is a little useless (numeric value). + warn(new Error().stack); return null; + } else if (!cmpMirage) return Engine.QueryInterface(ent, iid);