devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

Fix MissToMonst knockback bug

Open kphoenix137 opened this issue 3 weeks ago • 2 comments

Fixes: https://github.com/diasurgical/DevilutionX/issues/8039 Prevents charging monsters from readding a dead player to dPlayer. Also reorganizes code for clarity and consistency. I'm not certain if the same bug can happen with dMonster, but this PR would prevent it, if it did.

The problem:

  1. Player dies from the charging monster (MissToMonst).
  2. FixPlrWalkTags is called during death to remove the player from dPlayer.
  3. MissToMonst proceeds to knockback, and readds the player via player->occupyTile.
  4. Monsters are now able to continue knocking the corpse around.

kphoenix137 avatar Dec 03 '25 09:12 kphoenix137

Do you think maybe the charge should still push the player back, even if the charge killed the player? Perhaps the only thing it needs to avoid is adding the player back to dPlayer.

StephenCWills avatar Dec 04 '25 00:12 StephenCWills

Do you think maybe the charge should still push the player back, even if the charge killed the player? Perhaps the only thing it needs to avoid is adding the player back to dPlayer.

I'm not sure it can. When watching NiteKat's video, it was very clear the rhino attack is what killed him, however he wasn't knocked back. Unsure why. However it would certainly be a simple fix to apply knockback first, and then deal damage.

kphoenix137 avatar Dec 04 '25 01:12 kphoenix137