mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 09:33:47 +00:00
feat(Core/Spell): AssertSpellInfo (#6115)
* feat(Core/Spell): AssertSpellInfo (cherry picked from commite52878b6b5) (cherry picked from commit8c44259fae) Co-Authored-By: Shauren <shauren.trinity@gmail.com> Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com> * Update SpellMgr.h
This commit is contained in:
@@ -684,6 +684,14 @@ public:
|
||||
|
||||
// SpellInfo object management
|
||||
[[nodiscard]] SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : nullptr; }
|
||||
// Use this only with 100% valid spellIds
|
||||
SpellInfo const* AssertSpellInfo(uint32 spellId) const
|
||||
{
|
||||
ASSERT(spellId < GetSpellInfoStoreSize());
|
||||
SpellInfo const* spellInfo = mSpellInfoMap[spellId];
|
||||
ASSERT(spellInfo);
|
||||
return spellInfo;
|
||||
}
|
||||
[[nodiscard]] uint32 GetSpellInfoStoreSize() const { return mSpellInfoMap.size(); }
|
||||
|
||||
// Talent Additional Set
|
||||
|
||||
Reference in New Issue
Block a user