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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...