devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

Loading a Diablo save games corrupts Hellfire stash

Open ChaosMarc opened this issue 2 years ago • 5 comments

Operating System

Windows x64

DevilutionX version

1.4.1 (latest release)

Describe

I was trying to migrate some of my SP Diablo save games to Hellfire by renaming them from .sv to .hsv. The migration itself worked as expected: all items were still present and everything looked good until I opened the shared stash which looked like this: image

I've attached the broken hellfire stash file. Please let me know if a save game of one of the migrated chars is needed

stash.zip

PS: As I have no recent backup file of the stash I would be really grateful if it could be restored 😇

To Reproduce

  1. Create SP hellfire save game and store some items in stash page 1, save game and click "start new" in the esc menu
  2. Go to the settings and switch to diablo
  3. Create SP diablo save game, do nothing, save and click "start new" in the esc menu
  4. Go to the settings and switch back to hellfire
  5. Go to save game directory and rename the diablo save game from .sv to .hsv (update number if nessessary)
  6. Go back to the game (in hellfire mode), load game with the newly migrated Diablo char
  7. Check your stash: It switched to page 3 and when switching to page 1 the stored items are broken

Expected Behavior

Stash is not corrupted when migrating Diablo saves to Hellfire

Additional context

No response

ChaosMarc avatar Dec 07 '22 10:12 ChaosMarc

@AJenbo I've updated my post. it is reproduceable and happens every time a renamed diablo save game is loaded in hellfire. no further actions or saving the game are needed.

This is a zip with the following content:

  • single_0.hsv - initial hellfire char
  • single_1.hsv - migrated diablo char
  • stash.hsv - broken stash after loading single_1.hsv in hellfire for the first time data.zip

ChaosMarc avatar Dec 07 '22 10:12 ChaosMarc

Converting the stash is not supported. Hellfire items are 4 bytes larger then Diablo items and so there will be a miss alignment when trying to read them.

AJenbo avatar Dec 07 '22 10:12 AJenbo

But I didn't migrate the stash. just the char

ChaosMarc avatar Dec 07 '22 10:12 ChaosMarc

It might be because gbIsHellfireSaveGame isn't returned to it's previous state between loading a migrated save and loading the stash.

AJenbo avatar Dec 07 '22 10:12 AJenbo

A few days ago I almost ruined my hellfire stash again by playing around with importing a diablo save game to hellfire. This time though I had a recent backup :) Anyway, it reminded me of this issue here. Shouldn't it be labeled as a bug which it, at least to me, clearly is.

ChaosMarc avatar May 10 '23 12:05 ChaosMarc