Skip to content

Commit 6b7135c

Browse files
mewmewAJenbo
authored andcommitted
objects: add BUGFIX for OperateBook
myplr and pnum are used without consistency, thus making a sanity check for the spell level of the Guardian spell void. If another connected peer interacts with the Ancient Tome (then pnum!=myplr), and they have Guardian spell level < 15, while the local player has Guardian spell level = 15; then the sanity check is skipped, and the local player gets Guardian spell level 16
1 parent 4fad670 commit 6b7135c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/objects.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3074,7 +3074,7 @@ void OperateBook(int pnum, int i)
30743074

30753075
if (setlvlnum == SL_BONECHAMB) {
30763076
plr[myplr]._pMemSpells |= SPELLBIT(SPL_GUARDIAN);
3077-
if (plr[pnum]._pSplLvl[SPL_GUARDIAN] < MAX_SPELL_LEVEL)
3077+
if (plr[pnum]._pSplLvl[SPL_GUARDIAN] < MAX_SPELL_LEVEL) // BUGFIX: should use plr[myplr] or plr[pnum] consistently, not mix and match. If another connected peer interacts with the Ancient Tome (then pnum!=myplr), and they have Guardian spell level < 15, while the local player has Guardian spell level = 15; then the sanity check is skipped, and the local player gets Guardian spell level 16.
30783078
plr[myplr]._pSplLvl[SPL_GUARDIAN]++;
30793079
quests[Q_SCHAMB]._qactive = QUEST_DONE;
30803080
if (!deltaload)

0 commit comments

Comments
 (0)