devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

[Issue Report]: Ctrl+Click can delete items when the player is moving

Open StephenCWills opened this issue 1 year ago • 2 comments

Operating System

Windows x64

DevilutionX version

Custom build (please specify commit ID)

Describe

Tested using commit ID: 560aeac Seems to be present in 1.5.1 as well

There appear to be three conditions to reproduce the bug.

  • The player is moving in a non-southward direction (W/NW/N/NE/E)
  • The player is leaving a tile from which they cannot drop an item on the ground because it's surrounded by other items or obstacles
  • The player is entering a tile from which they can drop an item

If you Ctrl+Click an item in the player's inventory at a moment when all these conditions are met, the item will be deleted without a trace.

To Reproduce

  1. Load the following save: single_0.sv.zip
  2. Open the character's inventory
  3. Move the character to the West, Northwest, North, Northeast, or East
  4. Before the character has fully escaped the tile they started in, use Ctrl+Click to drop Gotterdamerung

Because the character must be moving in order to reproduce the bug, timing is crucial. I found it helpful to reduce the game speed to 5 in diablo.ini.

Expected Behavior

The item should either be dropped on the ground or kept on the player's cursor.

Additional context

Bug is demonstrated in the following video.

https://github.com/diasurgical/devilutionX/assets/9203145/cf71806b-dbe5-4b7a-a993-23f560162e81

StephenCWills avatar Feb 04 '24 17:02 StephenCWills

Is this in any way related to how knockback behaves when walking north vs south? Has that been made consistent yet or no?

The way you describe it seems like it could have the exact same root cause. Would be nice if the logic could be unified somehow (if it isn't already).

julealgon avatar Feb 04 '24 21:02 julealgon

I'm sure it's related, but I don't know if I'd say they share a root cause. It probably just indicates that the logic to find a place on the ground to drop the item uses the dPlayer array.

StephenCWills avatar Feb 04 '24 21:02 StephenCWills