From 20ac55ffef0576fba8fb6fa166fcdcf56d30ea3b Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 6 Jun 2025 00:22:25 +0200 Subject: Core/Spells: Fixed applying glyphs without exclusive category --- src/server/game/Spells/Spell.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 5f4af512673..b58516beabe 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6284,7 +6284,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32 if (!glyphBindableSpells) return SPELL_FAILED_INVALID_GLYPH; - if (std::find(glyphBindableSpells->begin(), glyphBindableSpells->end(), m_misc.SpellId) == glyphBindableSpells->end()) + if (!advstd::ranges::contains(*glyphBindableSpells, m_misc.SpellId)) return SPELL_FAILED_INVALID_GLYPH; if (std::vector const* glyphRequiredSpecs = sDB2Manager.GetGlyphRequiredSpecs(glyphId)) @@ -6292,7 +6292,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32 if (caster->GetPrimarySpecialization() == ChrSpecialization::None) return SPELL_FAILED_GLYPH_NO_SPEC; - if (std::find(glyphRequiredSpecs->begin(), glyphRequiredSpecs->end(), caster->GetPrimarySpecialization()) == glyphRequiredSpecs->end()) + if (!advstd::ranges::contains(*glyphRequiredSpecs, caster->GetPrimarySpecialization())) return SPELL_FAILED_GLYPH_INVALID_SPEC; } @@ -6301,7 +6301,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32 { if (std::vector const* activeGlyphBindableSpells = sDB2Manager.GetGlyphBindableSpells(activeGlyphId)) { - if (std::find(activeGlyphBindableSpells->begin(), activeGlyphBindableSpells->end(), m_misc.SpellId) != activeGlyphBindableSpells->end()) + if (advstd::ranges::contains(*activeGlyphBindableSpells, m_misc.SpellId)) { replacedGlyph = activeGlyphId; break; @@ -6317,8 +6317,12 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32 if (activeGlyphId == glyphId) return SPELL_FAILED_UNIQUE_GLYPH; - if (sGlyphPropertiesStore.AssertEntry(activeGlyphId)->GlyphExclusiveCategoryID == glyphProperties->GlyphExclusiveCategoryID) + if (glyphProperties->GlyphExclusiveCategoryID && sGlyphPropertiesStore.AssertEntry(activeGlyphId)->GlyphExclusiveCategoryID == glyphProperties->GlyphExclusiveCategoryID) + { + if (param1) + *param1 = glyphProperties->GlyphExclusiveCategoryID; return SPELL_FAILED_GLYPH_EXCLUSIVE_CATEGORY; + } } } break; -- cgit v1.2.3