devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

Item Removed When Re-Entering Dungeon at Max Floor Capacity

Open AardvarkBaron opened this issue 3 weeks ago • 1 comments

Operating System

Linux x64

DevilutionX version

1.5.5

Describe

If a dungeon level reaches the max limit of items dropped on floor, upon a player entering, a single item is removed. Just 1.

Multiple re entries does not decrease it past max limit - 1 ( I think 126 ? )

To Reproduce

  1. Enter any dungeon level
  2. Drop items on the floor, until the max limit is reached (unable to drop more)
  3. Exit level through stairs
  4. Re enter level
  5. Notice that an item is nuked, and that you are now able to drop a single item onto the floor

Expected Behavior

No item should be removed

Additional context

See video for visuals:

https://github.com/user-attachments/assets/4571df8c-b2cc-41cc-a318-f12dda870e56

AardvarkBaron avatar Dec 09 '25 01:12 AardvarkBaron

The problem appears to be a result of the fact that pregen items (items that get generated with the level) take up a slot in the delta and those slots are never freed up in the delta, but rather set to a "picked up" state, so that re-entering the level doesn't cause the item to respawn. So in theory, if you enter a level with 127 ground items pre-generated, pick them all up, then drop items, those items you dropped will vanish forever upon leaving the level and returning, since they're only held locally while you're in that level and there's no free slots in the delta to put them so they get saved. So the root of the problem really has nothing to do with filling up the floor with items to 127, but dropping any amount of items that's greater than max_items - num_pregen_items.

kphoenix137 avatar Dec 09 '25 20:12 kphoenix137