fix(Core/Spells): Only check GO state for doors when using SPELL_EFFECT_OPEN_LOCK (#9778)

buttons and other object types may expect other states in order to operate correctly
This commit is contained in:
Skjalf
2021-12-19 10:15:15 -03:00
committed by GitHub
parent b3ba18dff5
commit e5d650c5f3

View File

@@ -5870,9 +5870,9 @@ SpellCastResult Spell::CheckCast(bool strict)
// We must also ensure the gameobject we are opening is still closed by the time the spell finishes.
if (GameObject* go = m_targets.GetGOTarget())
{
if (go->GetGoState() != GO_STATE_READY)
if (go->GetGoType() == GAMEOBJECT_TYPE_DOOR && go->GetGoState() != GO_STATE_READY)
{
return SPELL_FAILED_BAD_TARGETS;
return SPELL_FAILED_ALREADY_OPEN;
}
}
if (m_spellInfo->Id != 1842 || (m_targets.GetGOTarget() &&