Browse Source

Fix a negative shift exponent sanitizer warning

Source/spells.h:53:14: runtime error: shift exponent -1 is negative

Fixes #4319
pull/4324/head
Gleb Mazovetskiy 4 years ago committed by Anders Jenbo
parent
commit
40b1cd6d8a
  1. 2
      Source/controls/modifier_hints.cpp

2
Source/controls/modifier_hints.cpp

@ -130,7 +130,7 @@ void DrawSpellsCircleMenuHint(const Surface &out, const Point &origin)
for (int slot = 0; slot < 4; ++slot) { for (int slot = 0; slot < 4; ++slot) {
splId = myPlayer._pSplHotKey[slot]; splId = myPlayer._pSplHotKey[slot];
if (splId != SPL_INVALID && (spells & GetSpellBitmask(splId)) != 0) if (splId != SPL_INVALID && splId != SPL_NULL && (spells & GetSpellBitmask(splId)) != 0)
splType = (currlevel == 0 && !spelldata[splId].sTownSpell) ? RSPLTYPE_INVALID : myPlayer._pSplTHotKey[slot]; splType = (currlevel == 0 && !spelldata[splId].sTownSpell) ? RSPLTYPE_INVALID : myPlayer._pSplTHotKey[slot];
else { else {
splType = RSPLTYPE_INVALID; splType = RSPLTYPE_INVALID;

Loading…
Cancel
Save