Remove members from a formation when they garrison. Fixes #2545
This was SVN commit r15181.
This commit is contained in:
parent
672f5a8b11
commit
317c6057ed
@ -2792,6 +2792,21 @@ var UnitFsmSpec = {
|
|||||||
if (cmpGarrisonHolder.Garrison(this.entity))
|
if (cmpGarrisonHolder.Garrison(this.entity))
|
||||||
{
|
{
|
||||||
this.isGarrisoned = true;
|
this.isGarrisoned = true;
|
||||||
|
|
||||||
|
if (this.formationController)
|
||||||
|
{
|
||||||
|
var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation);
|
||||||
|
if (cmpFormation)
|
||||||
|
{
|
||||||
|
// disable rearrange for this removal,
|
||||||
|
// but enable it again for the next
|
||||||
|
// move command
|
||||||
|
var rearrange = cmpFormation.rearrange;
|
||||||
|
cmpFormation.SetRearrange(false);
|
||||||
|
cmpFormation.RemoveMembers([this.entity]);
|
||||||
|
cmpFormation.SetRearrange(rearrange);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if we are garrisoned in a dropsite
|
// Check if we are garrisoned in a dropsite
|
||||||
var cmpResourceDropsite = Engine.QueryInterface(target, IID_ResourceDropsite);
|
var cmpResourceDropsite = Engine.QueryInterface(target, IID_ResourceDropsite);
|
||||||
|
Loading…
Reference in New Issue
Block a user