Fix promoting entities not reacting to nearby enemies.

When an entity promotes it autogarrisons in the turret position but
because `GARRISONE.enter` returns early a turret never reaches the
`IDLE`-state and thus won't automatically react on nearby enemies.
This is explicitly a temporary fix.

Differential revision: D3293
Reviewed by: @wraitii
This was SVN commit r24521.
This commit is contained in:
Freagarach 2021-01-07 15:30:25 +00:00
parent 3747b42f02
commit ebcf9b9ff5

View file

@ -3119,8 +3119,17 @@ UnitAI.prototype.UnitFsmSpec = {
return true;
}
if (this.IsGarrisoned())
// Called when autogarrisoning.
if (this.isGarrisoned)
{
this.SetImmobile(true);
if (this.IsTurret())
{
this.SetNextState("IDLE");
return true;
}
return false;
}
if (this.CanGarrison(target))
if (this.CheckGarrisonRange(target))