diff --git a/Source/spells.cpp b/Source/spells.cpp index 95e4a1946..95a42dca2 100644 --- a/Source/spells.cpp +++ b/Source/spells.cpp @@ -92,19 +92,6 @@ void UseMana(int id, spell_id sn) } } -/** - * @brief Gets a value that represents the specified spellID in 64bit bitmask format. - * For example: - * - spell ID 1: 0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0001 - * - spell ID 43: 0000.0000.0000.0000.0000.0100.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000 - * @param spellId The id of the spell to get a bitmask for. - * @return A 64bit bitmask representation for the specified spell. - */ -uint64_t GetSpellBitmask(int spellId) -{ - return 1ULL << (spellId - 1); -} - /** * @brief Gets a value indicating whether the player's current readied spell is a valid spell. Readied spells can be * invalidaded in a few scenarios where the spell comes from items, for example (like dropping the only scroll that diff --git a/Source/spells.h b/Source/spells.h index 0488c57d3..8554885d9 100644 --- a/Source/spells.h +++ b/Source/spells.h @@ -11,7 +11,6 @@ namespace devilution { int GetManaAmount(int id, spell_id sn); void UseMana(int id, spell_id sn); -uint64_t GetSpellBitmask(int spellId); bool CheckSpell(int id, spell_id sn, spell_type st, bool manaonly); void EnsureValidReadiedSpell(PlayerStruct &player); void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int spllvl); @@ -20,4 +19,17 @@ void DoHealOther(int pnum, int rid); int GetSpellBookLevel(spell_id s); int GetSpellStaffLevel(spell_id s); +/** + * @brief Gets a value that represents the specified spellID in 64bit bitmask format. + * For example: + * - spell ID 1: 0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0001 + * - spell ID 43: 0000.0000.0000.0000.0000.0100.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000 + * @param spellId The id of the spell to get a bitmask for. + * @return A 64bit bitmask representation for the specified spell. + */ +constexpr uint64_t GetSpellBitmask(int spellId) +{ + return 1ULL << (spellId - 1); +} + } // namespace devilution