From 1b24dac9428a4269db855556b5c99c159ea2e213 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Tue, 29 Oct 2019 23:27:26 +0000 Subject: [PATCH] Add BUGFIX comment in DrawSpell --- Source/control.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/control.cpp b/Source/control.cpp index 630ed66e3..83e9ee25e 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -380,6 +380,8 @@ void DrawSpell() spl = plr[myplr]._pRSpell; st = plr[myplr]._pRSplType; + + // BUGFIX: Move the next line into the if statement to avoid OOB (SPL_INVALID is -1) tlvl = plr[myplr]._pISplLvlAdd + plr[myplr]._pSplLvl[spl]; if (st == RSPLTYPE_SPELL && spl != SPL_INVALID) { if (!CheckSpell(myplr, spl, RSPLTYPE_SPELL, TRUE))