forked from 0ad/0ad
Initialize UnitAI component of initial garrisoned units, fixes #4281
This was SVN commit r18832.
This commit is contained in:
parent
c5e87628fb
commit
c24831387a
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user