From 74daab442aa82cf0b0fb84b4926fdbb6538f98ee Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 7 Jan 2021 02:55:16 +0100 Subject: [PATCH] Fix building Hellfire on multiple platforms --- Source/items.cpp | 1 + Source/pack.cpp | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index 418eedd17..d4d0b655e 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -3,6 +3,7 @@ * * Implementation of item functionality. */ +#include #include "all.h" #include "../3rdParty/Storm/Source/storm.h" diff --git a/Source/pack.cpp b/Source/pack.cpp index 344af853b..83ae7cf88 100644 --- a/Source/pack.cpp +++ b/Source/pack.cpp @@ -70,7 +70,7 @@ void PackPlayer(PkPlayerStruct *pPack, int pnum, BOOL manashield) pPack->pMaxManaBase = SwapLE32(pPlayer->_pMaxManaBase); pPack->pMemSpells = SDL_SwapLE64(pPlayer->_pMemSpells); - for (i = 0; i <= 36; i++) // Should be MAX_SPELLS-1 but set to 36 to make save games compatible + for (i = 0; i <= 36; i++) // Should be MAX_SPELLS-1 but set to 36 to make save games compatible pPack->pSplLvl[i] = pPlayer->_pSplLvl[i]; for (i = 37; i < 47; i++) pPack->pSplLvl2[i - 37] = pPlayer->_pSplLvl[i]; @@ -106,11 +106,9 @@ void PackPlayer(PkPlayerStruct *pPack, int pnum, BOOL manashield) pi++; } -#ifdef HELLFIRE - pPack->wReflection = pPlayer->wReflection; - pPack->pDifficulty = pPlayer->pDifficulty; - pPack->pDamAcFlags = pPlayer->pDamAcFlags; -#endif + pPack->wReflection = SwapLE16(pPlayer->wReflection); + pPack->pDifficulty = SwapLE32(pPlayer->pDifficulty); + pPack->pDamAcFlags = SwapLE32(pPlayer->pDamAcFlags); pPack->pDiabloKillLevel = SwapLE32(pPlayer->pDiabloKillLevel); if (gbMaxPlayers == 1 || manashield) @@ -265,14 +263,14 @@ void UnPackPlayer(PkPlayerStruct *pPack, int pnum, BOOL killok) } CalcPlrInv(pnum, FALSE); - pPlayer->wReflection = pPack->wReflection; + pPlayer->wReflection = SwapLE16(pPack->wReflection); pPlayer->pTownWarps = 0; pPlayer->pDungMsgs = 0; pPlayer->pDungMsgs2 = 0; pPlayer->pLvlLoad = 0; pPlayer->pDiabloKillLevel = SwapLE32(pPack->pDiabloKillLevel); pPlayer->pBattleNet = pPack->pBattleNet; - pPlayer->pManaShield = pPack->pManaShield; + pPlayer->pManaShield = SwapLE32(pPack->pManaShield); pPlayer->pDifficulty = SwapLE32(pPack->pDifficulty); pPlayer->pDamAcFlags = SwapLE32(pPack->pDamAcFlags); }