Fix garrison error with formations already in range.

The formation is set to an empty state upon disbanding which does not
have a `MEMBER`-substate.
Caused by c57a4d90a1.

Fixes: #6052
Differential revision: D3588
Reviewed by: @wraitii
This was SVN commit r24935.
This commit is contained in:
Freagarach 2021-02-21 09:18:05 +00:00
parent 03ed891029
commit ada0229f81

View File

@ -1177,7 +1177,9 @@ UnitAI.prototype.UnitFsmSpec = {
"GARRISONING": {
"enter": function() {
this.CallMemberFunction("Garrison", [this.order.data.target, false]);
this.SetNextState("MEMBER");
// We might have been disbanded due to the lack of members.
if (Engine.QueryInterface(this.entity, IID_Formation).GetMemberCount())
this.SetNextState("MEMBER");
return true;
},
},