diff --git a/Source/items.cpp b/Source/items.cpp index b7f88c8c1..8a2833d34 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -3783,20 +3783,18 @@ void SortWitch() void WitchBookLevel(int ii) { - int slvl; // edi + int slvl; if (witchitem[ii]._iMiscId == IMISC_BOOK) { witchitem[ii]._iMinMag = spelldata[witchitem[ii]._iSpell].sMinInt; slvl = plr[myplr]._pSplLvl[witchitem[ii]._iSpell]; - if (slvl) { - do { - witchitem[ii]._iMinMag += 20 * witchitem[ii]._iMinMag / 100; - --slvl; - if (witchitem[ii]._iMinMag > 255) { - witchitem[ii]._iMinMag = -1; - slvl = 0; - } - } while (slvl); + while (slvl) { + witchitem[ii]._iMinMag += 20 * witchitem[ii]._iMinMag / 100; + slvl--; + if (witchitem[ii]._iMinMag + 20 * witchitem[ii]._iMinMag / 100 > 255) { + witchitem[ii]._iMinMag = 255; + slvl = 0; + } } } }