Jump to content

when unit levels up, he loses armor bonus from athens hero


thankforpie
 Share

Recommended Posts

No.

But I do have a fix for something along the lines of what's reported. A regicide game would be lost if you promote your hero. D1694.

If I were to take a guess, I would be saying that whatever is handling that specific bonus is not listening to OnGlobalEntityRenamed and therefore considering the promoted unit dead. Dead units can't be in a formation and therefore it's doing the sensible thing of considering so.

Edit: Seems like Formations.js does not update auras when handling the message. Formations.js L926.

Edited by Guest
Link to comment
Share on other sites

Something like the following may fix it.

Spoiler

Index: Formation.js
===================================================================
--- Formation.js	(revision 21929)
+++ Formation.js	(working copy)
@@ -941,6 +941,12 @@
 		if (cmpNewUnitAI)
 			cmpNewUnitAI.SetFormationController(this.entity);
 
+		for (let ent of this.formationMembersWithAura)
+		{
+			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();

 

 

Link to comment
Share on other sites

The issue would still probably persist in the case of the Aura Caster being renamed. Barring that, it’s mostly correct.

A diff’s a diff wherever it is posted, ;) feel free to commit the thing.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...