From 73f7884b4a2767c6af4102a441999ac83c1d59ef Mon Sep 17 00:00:00 2001 From: Atrik Date: Fri, 20 Mar 2026 15:02:57 +0100 Subject: [PATCH] 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. --- binaries/data/mods/public/simulation/components/Formation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binaries/data/mods/public/simulation/components/Formation.js b/binaries/data/mods/public/simulation/components/Formation.js index 67e078b71d..f610e916b1 100644 --- a/binaries/data/mods/public/simulation/components/Formation.js +++ b/binaries/data/mods/public/simulation/components/Formation.js @@ -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);