Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Some death messages are printed twice

Open RedMisao opened this issue 4 months ago • 0 comments

Describe the bug

When you kill a panicked person, or a petrified person, their death message is printed twice This may be related to guilt assignment, or at the very least the death_function field (see Additional context)

Attach save file

N/A

Steps to reproduce

  1. Create a new world, character, etc
  2. Debug a mon_civilian_panic aka "panicked person" or a mon_civilian_stationary aka "petrified person" and kill it, either directly or by debug -> Map... -> Kill all monsters
  3. The death message is printed twice, with the guilt message printed in between
  4. Try 1 - 3 having Killer Drive or Uncaring. The guilt message is ommited, so the death message is printed as "The petrified person dies! x 2"
  5. Try 1 - 3 with a mon_mutant_alpha_boss aka "mutant child", see how the death_function message is printed first, and the default monster death message is printed after

Expected behavior

The death message should only be printed once

Screenshots

After killing a single panicked person image

After killing a single petrified person with the Debug method image

After adding the Uncaring trait by Debug, and killing a single petrified person image

After trying the same with mon_mutant_alpha_boss image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19044.2965 (21H2)
  • Game Version: 9437078 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth] ]

Additional context

This was noticed in #71619 by two people but it wasn't reported as a bug.

I'm guessing it's caused by the presence of the death_function field, which is adding a death message, instead of replacing it. Having a death_function with no message prints a default monster death message (The %s dies!), and then displays the default monster death message -> the P window merges both and displays them as The %s dies! x 2. This is the case for the panicked and petrified persons. However, having a death_function: message, such as with the mutant child, causes the custom message to be printed first, then the default monster death message is displayed.

RedMisao avatar Oct 20 '24 03:10 RedMisao