devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

[Issue Report]: Knockback Affects Dead Players

Open NiteKat opened this issue 6 months ago • 6 comments

Operating System

Windows x64

DevilutionX version

Custom build (please specify commit ID)

Describe

If a player is attacked with a monster's charge attack (such as from a Rhino or Goats using Rhino AI) and the player is dead, their corpse will be pushed back a tile (if possible) by the attack.

Encountered on commit b979b48bd of DAPI integration PR.

To Reproduce

  1. Go to a floor with enemies that use charge attacks that can cause knockback.
  2. Die with some of the enemies far enough away to trigger the attack and with a clear line of sight
  3. Wait for them to use the charge attack on your corpse.

Expected Behavior

Players should not be impacted by knockback after death.

Additional context

Clip of this happening on an AI run: https://www.twitch.tv/nitekat/clip/SullenOpenSalamanderBrokeBack-j_ey552Dc-n8_Tl5

NiteKat avatar Jun 25 '25 17:06 NiteKat

Thinking about this after submitting, I don't believe I've seen Diablo push corpses around with his melee attack, so this issue might be unique to charge attacks from monsters and not a knockback mechanism in general?

NiteKat avatar Jun 25 '25 17:06 NiteKat

Weird. Normally, death sets the invincible flag, meaning that missiles shouldn't be able to collide with the dead player.

https://github.com/diasurgical/DevilutionX/blob/4a22002769b6e6486c5d50c23e4d14f097105251/Source/missiles.cpp#L995-L997

EDIT: Ah, it doesn't use collision checks, because it's never supposed to miss.

StephenCWills avatar Jun 25 '25 18:06 StephenCWills

Is this a vanilla issue?

AJenbo avatar Oct 07 '25 22:10 AJenbo

Is this a vanilla issue?

That's a good question. I can't remember seeing this in vanilla, and I've only seen it this one time in DevilutionX. Getting a good setup to test in Vanilla is tricky, but I think we'll need to try to reproduce to confirm.

NiteKat avatar Oct 10 '25 13:10 NiteKat

Getting a good setup to test in Vanilla is tricky, but I think we'll need to try to reproduce to confirm.

If it's easier, perhaps we can figure out why it's happening in DevilutionX and determine if the logic has changed compared to Devilution.

EDIT: It looks to me like dead players are supposed to be removed from dPlayer and added as a flag to dFlags instead.

https://github.com/diasurgical/DevilutionX/blob/a60768a73f7fa7dd5d3878aab68637b6b974f47f/Source/player.cpp#L2732-L2733

If so, PlayerAtPosition() should not be able to retrieve the player ID of the dead player to apply knockback in the first place. Since the player is getting knocked back, we can assume that the player is getting added back to dPlayer at some point. We can probably just compare dPlayer between DevX and vanilla to determine if it's a vanilla issue.

StephenCWills avatar Oct 10 '25 13:10 StephenCWills

If my PR correctly fixes this, then it's definitely a vanilla bug.

kphoenix137 avatar Dec 03 '25 10:12 kphoenix137