Resolve game crash when syncing Diablo items in Hellfire games

This commit is contained in:
staphen 2022-01-16 14:41:36 -05:00 committed by Anders Jenbo
commit b85485b8f3
6 changed files with 26 additions and 20 deletions

View file

@ -3442,7 +3442,7 @@ void CornerstoneSave()
return;
if (!CornerStone.item.isEmpty()) {
ItemPack id;
PackItem(id, CornerStone.item);
PackItem(id, CornerStone.item, (CornerStone.item.dwBuff & CF_HELLFIRE) != 0);
const auto *buffer = reinterpret_cast<uint8_t *>(&id);
for (size_t i = 0; i < sizeof(ItemPack); i++) {
snprintf(&sgOptions.Hellfire.szItem[i * 2], 3, "%02hhX", buffer[i]);