forked from mirrors/0ad
Fix oversight from 832501fc9b and b93634fb28
When merging twin formations, the calls to AddMembers() and RemoveMembers() got inverted. RemoveMembers() calls UnsetFormationController() on each member, which overwrites the formation controller reference just set by AddMembers() to INVALID_ENTITY.
This commit is contained in:
@@ -1015,10 +1015,10 @@ Formation.prototype.UpdateTwinFormationsForMerge = function()
|
||||
continue;
|
||||
|
||||
const otherMembers = cmpOtherFormation.members;
|
||||
// Merge the members from the other formation into this one
|
||||
this.AddMembers(otherMembers, true);
|
||||
// The other formation will get disbanded for having no members
|
||||
cmpOtherFormation.RemoveMembers(otherMembers);
|
||||
// Merge the members from the other formation into this one
|
||||
this.AddMembers(otherMembers, true);
|
||||
// Remove the merged formation from twin formations list
|
||||
this.twinFormations.splice(i, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user