diff --git a/Source/inv.cpp b/Source/inv.cpp index f70004eaa..cb10e2c08 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -1861,7 +1861,7 @@ void __fastcall RemoveInvItem(int pnum, int iv) { if ( plr[pnum]._pRSpell != SPL_INVALID ) { - // BUGFIX: Cast the literal `1` to `UINT64` to make that bitshift 64bit + // BUGFIX: Cast the literal `1` to `unsigned __int64` to make that bitshift 64bit // this causes the last 4 skills to not reset correctly after use if ( !( plr[pnum]._pScrlSpells64 @@ -1885,7 +1885,7 @@ void __fastcall RemoveSpdBarItem(int pnum, int iv) { if ( plr[pnum]._pRSpell != SPL_INVALID ) { - // BUGFIX: Cast the literal `1` to `UINT64` to make that bitshift 64bit + // BUGFIX: Cast the literal `1` to `unsigned __int64` to make that bitshift 64bit // this causes the last 4 skills to not reset correctly after use if ( !( plr[pnum]._pScrlSpells64 diff --git a/Source/items.cpp b/Source/items.cpp index 313ce2853..12fbc9009 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -775,7 +775,7 @@ void __fastcall CalcPlrItemVals(int p, BOOL Loadgfx) int dadd = 0; // added dexterity int vadd = 0; // added vitality - UINT64 spl = 0; // bitarray for all enabled/active spells + unsigned __int64 spl = 0; // bitarray for all enabled/active spells signed int fr = 0; // fire resistance signed int lr = 0; // lightning resistance @@ -938,7 +938,7 @@ void __fastcall CalcPlrItemVals(int p, BOOL Loadgfx) // check if the current RSplType is a valid/allowed spell if ( plr[p]._pRSplType == RSPLTYPE_CHARGES - && !(spl & ((UINT64)1 << (plr[p]._pRSpell - 1))) ) + && !(spl & ((unsigned __int64)1 << (plr[p]._pRSpell - 1))) ) { plr[p]._pRSpell = SPL_INVALID; plr[p]._pRSplType = RSPLTYPE_INVALID; diff --git a/Source/player.cpp b/Source/player.cpp index eaa5d86b9..dac306b32 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -3105,7 +3105,7 @@ BOOL __fastcall PM_DoSpell(int pnum) if ( !plr[pnum]._pSplFrom ) { if ( plr[pnum]._pRSplType == RSPLTYPE_SCROLL) { if ( !(plr[pnum]._pScrlSpells64 - & (UINT64)1 << (plr[pnum]._pRSpell - 1)) + & (unsigned __int64)1 << (plr[pnum]._pRSpell - 1)) ) { plr[pnum]._pRSpell = SPL_INVALID; plr[pnum]._pRSplType = RSPLTYPE_INVALID; @@ -3115,7 +3115,7 @@ BOOL __fastcall PM_DoSpell(int pnum) if ( plr[pnum]._pRSplType == RSPLTYPE_CHARGES) { if ( !(plr[pnum]._pISpells64 - & (UINT64)1 << (plr[pnum]._pRSpell - 1)) + & (unsigned __int64)1 << (plr[pnum]._pRSpell - 1)) ) { plr[pnum]._pRSpell = SPL_INVALID; plr[pnum]._pRSplType = RSPLTYPE_INVALID; diff --git a/structs.h b/structs.h index 1da28b356..26180816e 100644 --- a/structs.h +++ b/structs.h @@ -213,15 +213,15 @@ struct PlayerStruct char _pSBkSplType; char _pSplLvl[64]; union { - __int64 _pMemSpells64; + unsigned __int64 _pMemSpells64; int _pMemSpells[2]; }; union { - __int64 _pAblSpells64; + unsigned __int64 _pAblSpells64; int _pAblSpells[2]; }; union { - __int64 _pScrlSpells64; + unsigned __int64 _pScrlSpells64; int _pScrlSpells[2]; }; int _pSpellFlags; @@ -322,7 +322,7 @@ struct PlayerStruct int _pIBonusAC; int _pIBonusDamMod; union { - __int64 _pISpells64; + unsigned __int64 _pISpells64; int _pISpells[2]; }; int _pIFlags;