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.
This commit is contained in:
elexis 2018-04-25 12:26:34 +00:00
parent ec8d95abe1
commit fa01a67d42

View file

@ -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)