Ensure consistent types for '_pScrlSpells' and '_pISpells' operations
This commit is contained in:
parent
b10b4381ef
commit
c2ed83eb5e
3 changed files with 8 additions and 12 deletions
|
|
@ -1673,11 +1673,9 @@ void RemoveInvItem(int pnum, int iv)
|
|||
|
||||
if (plr[pnum]._pRSplType == RSPLTYPE_SCROLL) {
|
||||
if (plr[pnum]._pRSpell != SPL_INVALID) {
|
||||
// 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]._pScrlSpells
|
||||
& (1 << (plr[pnum]._pRSpell - 1)))) {
|
||||
& (1ULL << (plr[pnum]._pRSpell - 1)))) {
|
||||
plr[pnum]._pRSpell = SPL_INVALID;
|
||||
}
|
||||
|
||||
|
|
@ -1737,11 +1735,9 @@ void RemoveSpdBarItem(int pnum, int iv)
|
|||
|
||||
if (plr[pnum]._pRSplType == RSPLTYPE_SCROLL) {
|
||||
if (plr[pnum]._pRSpell != SPL_INVALID) {
|
||||
// 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]._pScrlSpells
|
||||
& (1 << (plr[pnum]._pRSpell - 1)))) {
|
||||
& (1ULL << (plr[pnum]._pRSpell - 1)))) {
|
||||
plr[pnum]._pRSpell = SPL_INVALID;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -908,7 +908,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
|
|||
|
||||
// check if the current RSplType is a valid/allowed spell
|
||||
if (plr[p]._pRSplType == RSPLTYPE_CHARGES
|
||||
&& !(spl & ((unsigned __int64)1 << (plr[p]._pRSpell - 1)))) {
|
||||
&& !(spl & (1ULL << (plr[p]._pRSpell - 1)))) {
|
||||
plr[p]._pRSpell = SPL_INVALID;
|
||||
plr[p]._pRSplType = RSPLTYPE_INVALID;
|
||||
force_redraw = 255;
|
||||
|
|
@ -1154,18 +1154,18 @@ void CalcPlrScrolls(int p)
|
|||
for (i = 0; i < plr[p]._pNumInv; i++) {
|
||||
if (plr[p].InvList[i]._itype != ITYPE_NONE && (plr[p].InvList[i]._iMiscId == IMISC_SCROLL || plr[p].InvList[i]._iMiscId == IMISC_SCROLLT)) {
|
||||
if (plr[p].InvList[i]._iStatFlag)
|
||||
plr[p]._pScrlSpells |= (__int64)1 << (plr[p].InvList[i]._iSpell - 1);
|
||||
plr[p]._pScrlSpells |= 1ULL << (plr[p].InvList[i]._iSpell - 1);
|
||||
}
|
||||
}
|
||||
|
||||
for (j = 0; j < MAXBELTITEMS; j++) {
|
||||
if (plr[p].SpdList[j]._itype != ITYPE_NONE && (plr[p].SpdList[j]._iMiscId == IMISC_SCROLL || plr[p].SpdList[j]._iMiscId == IMISC_SCROLLT)) {
|
||||
if (plr[p].SpdList[j]._iStatFlag)
|
||||
plr[p]._pScrlSpells |= (__int64)1 << (plr[p].SpdList[j]._iSpell - 1);
|
||||
plr[p]._pScrlSpells |= 1ULL << (plr[p].SpdList[j]._iSpell - 1);
|
||||
}
|
||||
}
|
||||
if (plr[p]._pRSplType == RSPLTYPE_SCROLL) {
|
||||
if (!(plr[p]._pScrlSpells & 1 << (plr[p]._pRSpell - 1))) {
|
||||
if (!(plr[p]._pScrlSpells & 1ULL << (plr[p]._pRSpell - 1))) {
|
||||
plr[p]._pRSpell = SPL_INVALID;
|
||||
plr[p]._pRSplType = RSPLTYPE_INVALID;
|
||||
force_redraw = 255;
|
||||
|
|
|
|||
|
|
@ -3190,7 +3190,7 @@ BOOL PM_DoSpell(int pnum)
|
|||
if (!plr[pnum]._pSplFrom) {
|
||||
if (plr[pnum]._pRSplType == RSPLTYPE_SCROLL) {
|
||||
if (!(plr[pnum]._pScrlSpells
|
||||
& (unsigned __int64)1 << (plr[pnum]._pRSpell - 1))) {
|
||||
& 1ULL << (plr[pnum]._pRSpell - 1))) {
|
||||
plr[pnum]._pRSpell = SPL_INVALID;
|
||||
plr[pnum]._pRSplType = RSPLTYPE_INVALID;
|
||||
force_redraw = 255;
|
||||
|
|
@ -3199,7 +3199,7 @@ BOOL PM_DoSpell(int pnum)
|
|||
|
||||
if (plr[pnum]._pRSplType == RSPLTYPE_CHARGES) {
|
||||
if (!(plr[pnum]._pISpells
|
||||
& (unsigned __int64)1 << (plr[pnum]._pRSpell - 1))) {
|
||||
& 1ULL << (plr[pnum]._pRSpell - 1))) {
|
||||
plr[pnum]._pRSpell = SPL_INVALID;
|
||||
plr[pnum]._pRSplType = RSPLTYPE_INVALID;
|
||||
force_redraw = 255;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue