diff --git a/Source/msg.cpp b/Source/msg.cpp index feb646ab0..eba05898b 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -1462,7 +1462,7 @@ size_t OnSpellWall(const TCmd *pCmd, Player &player) if (wParam1 > SPL_LAST) return sizeof(message); const uint16_t wParam2 = SDL_SwapLE16(message.wParam2); - if (wParam2 > static_cast(SpellType::LAST)) + if (wParam2 > static_cast(SpellType::Invalid)) return sizeof(message); auto spell = static_cast(wParam1); @@ -1503,7 +1503,7 @@ size_t OnSpellTile(const TCmd *pCmd, Player &player) if (wParam1 > SPL_LAST) return sizeof(message); const uint16_t wParam2 = SDL_SwapLE16(message.wParam2); - if (wParam2 > static_cast(SpellType::LAST)) + if (wParam2 > static_cast(SpellType::Invalid)) return sizeof(message); auto spell = static_cast(wParam1); @@ -1653,7 +1653,7 @@ size_t OnSpellMonster(const TCmd *pCmd, Player &player) if (wParam2 > SPL_LAST) return sizeof(message); const uint16_t wParam3 = SDL_SwapLE16(message.wParam3); - if (wParam3 > static_cast(SpellType::LAST)) + if (wParam3 > static_cast(SpellType::Invalid)) return sizeof(message); auto spell = static_cast(wParam2); @@ -1692,7 +1692,7 @@ size_t OnSpellPlayer(const TCmd *pCmd, Player &player) if (wParam2 > SPL_LAST) return sizeof(message); const uint16_t wParam3 = SDL_SwapLE16(message.wParam3); - if (wParam3 > static_cast(SpellType::LAST)) + if (wParam3 > static_cast(SpellType::Invalid)) return sizeof(message); auto spell = static_cast(wParam2); diff --git a/Source/panels/spell_list.cpp b/Source/panels/spell_list.cpp index f29c29d99..db22cbb4e 100644 --- a/Source/panels/spell_list.cpp +++ b/Source/panels/spell_list.cpp @@ -215,7 +215,7 @@ std::vector GetSpellListItems() case SpellType::Charges: mask = myPlayer._pISpells; break; - case SpellType::Invalid: + default: break; } int8_t j = SPL_FIREBOLT; diff --git a/Source/spelldat.h b/Source/spelldat.h index 17cfaa58a..4ef1bf260 100644 --- a/Source/spelldat.h +++ b/Source/spelldat.h @@ -19,8 +19,8 @@ enum class SpellType : uint8_t { Spell, Scroll, Charges, + LAST = Charges, Invalid, - LAST = Invalid, }; enum spell_id : int8_t {