Core/Spells: Cleanup player typeid checks and casts in WorldSession::HandleCastSpellOpcode

This commit is contained in:
Shauren
2023-07-12 14:55:38 +02:00
parent 7324a0ac1a
commit 04aab7b540

View File

@@ -352,13 +352,13 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
HandleClientCastFlags(recvPacket, castFlags, targets);
// not have spell in spellbook
if (_player->GetTypeId() == TYPEID_PLAYER && !_player->ToPlayer()->HasActiveSpell(spellId))
if (!_player->HasActiveSpell(spellId))
{
bool allow = false;
// allow casting of unknown spells for special lock cases
if (GameObject *go = targets.GetGOTarget())
if (go->GetSpellForLock(_player->ToPlayer()) == spellInfo)
if (GameObject* go = targets.GetGOTarget())
if (go->GetSpellForLock(_player) == spellInfo)
allow = true;
// allow casting of spells triggered by clientside periodic trigger auras