Opened 3 years ago

Closed 3 years ago

#6162 closed defect (fixed)

Mercenaries are duplicated

Reported by: Stan Owned by: Freagarach
Priority: Release Blocker Milestone: Alpha 25
Component: Simulation Keywords:
Cc: Freagarach Patch: Phab:D3918

Description

Steps to reproduce

  • Garrison mercenaries
  • Do the upgrade to lvl2
  • Notice you now have duplicated mercenaries outside the building and inside it.

Or see attached replay.

Attachments (1)

2021-04-30_0003.zip (37.6 KB ) - added by Stan 3 years ago.
replay

Download all attachments as: .zip

Change History (5)

by Stan, 3 years ago

Attachment: 2021-04-30_0003.zip added

replay

comment:1 by Silier, 3 years ago

Milestone: BacklogAlpha 25

no release blockers on backlog pls

comment:2 by Freagarach, 3 years ago

This is a nice one.

It depends on the structure you garrison the mercenaries in. Which leads to the barracks. Which happens to also have a XP trickle.

Situation:

  • Merc in barracks, which is trickling XP.
  • OnValueModification -> Merc is being promoted, old merc still exists.
  • The old merc is ejected from the barracks, thus removing the trickle aura, triggering another value modification message.
  • That new value modification message triggers another promotion.
  • Only then does the first ChangeEntityTemplate finish, setting this.promotedUnitEntity, which would cause any extra increased XP to be forwarded.

comment:3 by Freagarach, 3 years ago

Owner: set to Freagarach
Patch: Phab:D3918

comment:4 by Freagarach, 3 years ago

Resolution: fixed
Status: newclosed

In 25439:

Fix duplicating promoting entities in XP trickling structures.

The entity received a value modif. message while promoting, triggering a second promotion.

Differential revision: https://code.wildfiregames.com/D3918
Fixes: #6162
Comments by: @Angen, @Stan

Note: See TracTickets for help on using tickets.