From fa01a67d420f739550f70684f6f7ebf2d87e0299 Mon Sep 17 00:00:00 2001 From: elexis Date: Wed, 25 Apr 2018 12:26:34 +0000 Subject: [PATCH] Fix gaia becoming defeated due to yet another missing IsInWorld check. The check should have been in there for mods (garrisonable CCs) since the first version, but it was needed the hard way by units becoming targets in 76d648349d. This was SVN commit r21782. --- .../mods/public/maps/random/jebel_barkal_triggers.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js b/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js index a786a11192..afa7ba386a 100644 --- a/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js +++ b/binaries/data/mods/public/maps/random/jebel_barkal_triggers.js @@ -509,11 +509,17 @@ Trigger.prototype.JebelBarkal_SpawnAttackerGroups = function() if (!this.jebelBarkal_attackerGroupSpawnPoints) return; + this.JebelBarkal_StartAttackTimer(jebelBarkal_attackInterval()); + this.debugLog("Attacker wave (at most " + (jebelBarkal_maxPopulation - this.jebelBarkal_attackerUnits.length) + " attackers)"); let time = TriggerHelper.GetMinutes(); + let activePlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetActivePlayers(); - let playerEntities = activePlayers.map(playerID => TriggerHelper.GetEntitiesByPlayer(playerID)); + let playerEntities = activePlayers.map(playerID => + TriggerHelper.GetEntitiesByPlayer(playerID).filter(TriggerHelper.IsInWorld)); + let patrolPoints = this.GetTriggerPoints(jebelBarkal_attackerGroup_triggerPointPatrol); + let groupSizeFactor = jebelBarkal_attackerGroup_sizeFactor( activePlayers.length, this.numInitialSpawnPoints, @@ -582,8 +588,6 @@ Trigger.prototype.JebelBarkal_SpawnAttackerGroups = function() "message": markForTranslation("Napata is attacking!"), "translateMessage": true }); - - this.JebelBarkal_StartAttackTimer(jebelBarkal_attackInterval()); }; Trigger.prototype.JebelBarkal_StartAttackTimer = function(delay)