mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 18:43:39 +00:00
Make sure units in INDIVIDUAL state don't belong to a formation. Should fix #2380
This was SVN commit r14581.
This commit is contained in:
@@ -1334,6 +1334,14 @@ var UnitFsmSpec = {
|
||||
// Sanity-checking
|
||||
if (this.IsAnimal())
|
||||
error("Animal got moved into INDIVIDUAL.* state");
|
||||
|
||||
// an entity in individual state shouldn't belong to a formation
|
||||
if (this.IsFormationMember())
|
||||
{
|
||||
var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation);
|
||||
if (cmpFormation)
|
||||
cmpFormation.RemoveMembers([this.entity]);
|
||||
}
|
||||
},
|
||||
|
||||
"Attacked": function(msg) {
|
||||
|
||||
Reference in New Issue
Block a user