mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Spells: Fixed applying glyphs without exclusive category
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user