Item Removed When Re-Entering Dungeon at Max Floor Capacity
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
- Enter any dungeon level
- Drop items on the floor, until the max limit is reached (unable to drop more)
- Exit level through stairs
- Re enter level
- 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
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.