Initialize UnitAI component of initial garrisoned units, fixes #4281

This was SVN commit r18832.
This commit is contained in:
mimo 2016-10-13 17:38:13 +00:00
parent c5e87628fb
commit c24831387a

View File

@ -737,8 +737,8 @@ GarrisonHolder.prototype.OnGlobalInitGame = function(msg)
for (let ent of this.initGarrison)
{
let cmpUnitAI = Engine.QueryInterface(ent, IID_UnitAI);
if (cmpUnitAI && cmpUnitAI.CanGarrison(this.entity))
this.Garrison(ent);
if (cmpUnitAI && cmpUnitAI.CanGarrison(this.entity) && this.Garrison(ent))
cmpUnitAI.SetGarrisoned();
}
this.initGarrison = undefined;
};