diff --git a/Source/inv.cpp b/Source/inv.cpp index 7d8c30b0a..4007481e4 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -1911,7 +1911,7 @@ void RemoveScroll(Player &player) for (int i = 0; i < player._pNumInv; i++) { if (!player.InvList[i].isEmpty() && (player.InvList[i]._iMiscId == IMISC_SCROLL || player.InvList[i]._iMiscId == IMISC_SCROLLT) - && player.InvList[i]._iSpell == player._pRSpell) { + && player.InvList[i]._iSpell == player._pSpell) { player.RemoveInvItem(i); player.CalcScrolls(); return; diff --git a/test/inv_test.cpp b/test/inv_test.cpp index 24f8073b7..70516c44f 100644 --- a/test/inv_test.cpp +++ b/test/inv_test.cpp @@ -198,7 +198,7 @@ TEST(Inv, RemoveScroll_inventory) // Put a firebolt scroll into the inventory Players[MyPlayerId]._pNumInv = 1; - Players[MyPlayerId]._pRSpell = static_cast(SPL_FIREBOLT); + Players[MyPlayerId]._pSpell = static_cast(SPL_FIREBOLT); Players[MyPlayerId].InvList[0]._itype = ITYPE_MISC; Players[MyPlayerId].InvList[0]._iMiscId = IMISC_SCROLL; Players[MyPlayerId].InvList[0]._iSpell = SPL_FIREBOLT;