devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

Cornerstone item vanishes

Open StephenCWills opened this issue 3 years ago • 2 comments

Describe Item dropped on Cornerstone vanishes.

To Reproduce Steps to reproduce the behavior:

  1. Go to Crypt level 1
  2. Locate the Cornerstone of the World
  3. Select Save Game from the in-game menu
  4. Select Load Game from the in-game menu (to reproduce the issue, you must load your game from the game menu rather than the main menu)
  5. Drop an item on the Cornerstone that you don't want to keep
  6. Cast Town Portal and go to town
  7. Reenter the Town Portal to return to the Cornerstone
  8. The item has vanished

Expected behavior One copy of an item dropped on the Cornerstone should be shared with all Single Player Hellfire characters.

Additional context The cause seems to be due to the order of operations in gamemenu_load_game().

https://github.com/diasurgical/devilutionX/blob/ca93d852d2f22eb82a04014d0c63e4c5373f8906/Source/gamemenu.cpp#L307-L309

In the snippet above, LoadGame() leads to dungeon generation. If the game was saved on Crypt level 1, at some point this will call CornerstoneLoad() which activates the Cornerstone. However, two lines later in gamemenu_load_game(), the Cornerstone is unconditionally deactivated, rendering the tile inert. If an item is dropped on the tile at this point, it will be captured as part of the game's state instead of saving it as the Cornerstone item. If you then leave Crypt level 1 and come back, it will rerun dungeon generation logic, activate the Cornerstone, and overwrite game state for that tile, causing the item to vanish.

I've confirmed that this same issue exists in vanilla Hellfire. I've also confirmed that a similar process can be used to very easily dupe items, however I'd like to leave that one as an exercise for the reader.

StephenCWills avatar Jan 23 '22 01:01 StephenCWills

Given that the cornerstone is rendered obsolete by the stash, do you think we should disable its functionality entirely, and leave it as a decorative piece?

kphoenix137 avatar Dec 07 '25 03:12 kphoenix137

seems a bit sad

AJenbo avatar Dec 08 '25 16:12 AJenbo