Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3544 closed defect (fixed)

[PATCH] Dead Units Can be promoted

Reported by: Stan Owned by: Karamel
Priority: Should Have Milestone: Alpha 20
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description (last modified by elexis)

As reported by Karamel if a unit gets killed while it's killing another unit, it dies, and then get promoted, creating a new fresh soldier that isn't dead. It ought not to be promoted in that case.

http://trac.wildfiregames.com/raw-attachment/ticket/3544/reborn.gif

Attachments (5)

sibyllae_vox_tkt3544.zip (943.4 KB ) - added by Karamel 8 years ago.
Mod to use to play the replay and reproduce the bug (found on r17141)
replay_tkt3544.zip (14.2 KB ) - added by Karamel 8 years ago.
The game data in which the bug happened (see around 3:30 in the skirmishers duel below red CC)
0001-Fix-promotion-of-dead-units.patch (1.7 KB ) - added by Karamel 8 years ago.
Simple patch with HP check before promoting
commands_micro.txt (4.9 KB ) - added by elexis 8 years ago.
Minimal replay for r17460.
reborn.gif (1.7 MB ) - added by elexis 8 years ago.

Change History (11)

by Karamel, 8 years ago

Attachment: sibyllae_vox_tkt3544.zip added

Mod to use to play the replay and reproduce the bug (found on r17141)

by Karamel, 8 years ago

Attachment: replay_tkt3544.zip added

The game data in which the bug happened (see around 3:30 in the skirmishers duel below red CC)

by Karamel, 8 years ago

Simple patch with HP check before promoting

comment:1 by Karamel, 8 years ago

Keywords: patch review added

As suggested by Stanislas an HP check before promoting fixed the bug.

To reproduce it use the attached mod and play the replay data on r17141 (may happen with later revision though).

At around 3:30 the blue cavalry skirmishers goes below the red CC, followed by a red skirmisher. a duel happens and both get killed. The red skirmisher is dead but a new skirmisher is spawned cheering on the body of it's previous shape.

comment:2 by elexis, 8 years ago

Milestone: BacklogAlpha 20

comment:3 by Stan, 8 years ago

Owner: set to Karamel
Summary: Dead Units Can be promoted[PATCH] Dead Units Can be promoted

by elexis, 8 years ago

Attachment: commands_micro.txt added

Minimal replay for r17460.

by elexis, 8 years ago

Attachment: reborn.gif added

comment:4 by elexis, 8 years ago

Description: modified (diff)

I could reproduce the issue by letting a guy hunt chicken until he would become promoted. Added debug output to Promote.js to see on which turn it happens. Then added a delete command on that turn for that entity, voila.

comment:5 by elexis, 8 years ago

Resolution: fixed
Status: newclosed

In 17461:

Don't resurrect dead units when trying to promoting them while they die. Patch by karamel, fixes #3544.

comment:6 by elexis, 8 years ago

Keywords: review removed

Thanks for the patch! Keep it up!

Note: See TracTickets for help on using tickets.