Core/Spells: Check passive attribute on the final spell that will be cast by CMSG_CAST_SPELL, after taking overriden spells into account

This commit is contained in:
Shauren
2023-05-06 13:53:26 +02:00
parent fa242fac76
commit a1e2ad439d

View File

@@ -311,9 +311,6 @@ void WorldSession::HandleCastSpellOpcode(WorldPackets::Spells::CastSpell& cast)
return;
}
if (spellInfo->IsPassive())
return;
Unit* caster = mover;
if (caster->GetTypeId() == TYPEID_UNIT && !caster->ToCreature()->HasSpell(spellInfo->Id))
{
@@ -354,6 +351,9 @@ void WorldSession::HandleCastSpellOpcode(WorldPackets::Spells::CastSpell& cast)
// Check possible spell cast overrides
spellInfo = caster->GetCastSpellInfo(spellInfo);
if (spellInfo->IsPassive())
return;
// can't use our own spells when we're in possession of another unit,
if (_player->isPossessing())
return;