Index: ps/trunk/binaries/data/mods/public/maps/scripts/CaptureTheRelic.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/scripts/CaptureTheRelic.js +++ ps/trunk/binaries/data/mods/public/maps/scripts/CaptureTheRelic.js @@ -42,6 +42,12 @@ if (potentialGaiaSpawnPoints.length) potentialSpawnPoints = potentialGaiaSpawnPoints; + if (!potentialSpawnPoints.length) + { + error("No gaia entities found on this map that could be used as spawn points!"); + return; + } + let numSpawnedRelics = Math.ceil(TriggerHelper.GetNumberOfPlayers() / 2); this.playerRelicsCount = new Array(TriggerHelper.GetNumberOfPlayers()).fill(0, 1); this.playerRelicsCount[0] = numSpawnedRelics; @@ -64,14 +70,15 @@ if (!cmpIdentity || !cmpIdentity.HasClass("Relic") || data.from == -1) return; + --this.playerRelicsCount[data.from]; + if (data.to == -1) { - error("Relic entity " + data.entity + " has been destroyed"); - return; + warn("Relic entity " + data.entity + " has been destroyed"); + this.relics.splice(this.relics.indexOf(data.entity), 1); } - - --this.playerRelicsCount[data.from]; - ++this.playerRelicsCount[data.to]; + else + ++this.playerRelicsCount[data.to]; this.CheckCaptureTheRelicCountdown(); }; @@ -126,6 +133,9 @@ cmpGuiInterface.DeleteTimeNotification(this.othersRelicsVictoryMessage); } + if (!this.relics.length) + return; + let others = [-1]; for (let playerID = 1; playerID < TriggerHelper.GetNumberOfPlayers(); ++playerID) {