aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-06-06 00:22:25 +0200
committerShauren <shauren.trinity@gmail.com>2025-06-06 00:22:25 +0200
commit20ac55ffef0576fba8fb6fa166fcdcf56d30ea3b (patch)
treee72884d8914517ebf4b4b23f7d63598b7779e15d /src/server/game/Spells/Spell.cpp
parent1e23aed35d5d7f763705271c40b7ba9008501cf3 (diff)
Core/Spells: Fixed applying glyphs without exclusive category
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp12
1 files 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<ChrSpecialization> 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<uint32> 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;