fixes petra javascript warnings

This was SVN commit r15543.
This commit is contained in:
mimo 2014-07-21 16:19:59 +00:00
parent a9048fa43d
commit 9d505f2fd1

View File

@ -1404,6 +1404,8 @@ m.AttackPlan.prototype.Abort = function(gameState)
{
// Do not use QuickIter with forEach when forEach removes elements
this.unitCollection.preventQuickIter();
if (this.unitCollection.length)
{
// If the attack was started, and we are on the same land as the rallyPoint, go back there
var rallyPoint = this.rallyPoint;
var planIndex = gameState.ai.accessibility.getAccessValue(this.position);
@ -1419,6 +1421,7 @@ m.AttackPlan.prototype.Abort = function(gameState)
}
ent.setMetadata(PlayerID, "plan", -1);
});
}
for (var unitCat in this.unitStat) {
delete this.unitStat[unitCat];