Index: binaries/data/mods/public/simulation/components/Formation.js =================================================================== --- binaries/data/mods/public/simulation/components/Formation.js +++ binaries/data/mods/public/simulation/components/Formation.js @@ -933,6 +933,9 @@ { this.members[this.members.indexOf(msg.entity)] = msg.newentity; this.memberPositions[msg.newentity] = this.memberPositions[msg.entity]; + + if (this.formationMembersWithAura.indexOf(msg.entity) != -1) + this.formationMembersWithAura[this.formationMembersWithAura.indexOf(msg.entity)] = msg.newentity; } var cmpOldUnitAI = Engine.QueryInterface(msg.entity, IID_UnitAI); @@ -941,6 +944,16 @@ if (cmpNewUnitAI) cmpNewUnitAI.SetFormationController(this.entity); + for (let ent of this.formationMembersWithAura) + { + // Don't apply the aura to the aura caster + if (ent != msg.newentity) + { + let cmpAuras = Engine.QueryInterface(ent, IID_Auras); + cmpAuras.ApplyFormationBonus(msg.newentity); + } + } + // Because the renamed entity might have different characteristics, // (e.g. packed vs. unpacked siege), we need to recompute motion parameters this.ComputeMotionParameters();