Fix a bug in TestAllMemberFunction and initialize a variable in cmpBattleDetection. Refs #2372.

This was SVN commit r14579.
This commit is contained in:
leper 2014-01-12 23:13:24 +00:00
parent a26ab7b1e7
commit 2ca0a20f81
2 changed files with 2 additions and 1 deletions

View File

@ -36,6 +36,7 @@ BattleDetection.prototype.Init = function()
this.damage = 0; // Damage counter. Accumulative damage done over the current timer period.
this.damageRecord = []; // Damage record. Array of elements representing total damage done in a given timer cycle.
this.alertness = 0; // Alertness level. Incremented if damage rate exceeds 'damageRateThreshold' over a given timer period and decremented if it does not.
this.state = "PEACE";
};
BattleDetection.prototype.setState = function(state)

View File

@ -5600,7 +5600,7 @@ UnitAI.prototype.TestAllMemberFunction = function(funcname, args)
for each (var ent in members)
{
var cmpUnitAI = Engine.QueryInterface(ent, IID_UnitAI);
if (!cmpUnitAI[funcname].apply(cmpUnitAI, args));
if (!cmpUnitAI[funcname].apply(cmpUnitAI, args))
return false;
}
return true;