From e5d650c5f3e35973b8b9acfbab31857c9a1c4134 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 19 Dec 2021 10:15:15 -0300 Subject: [PATCH] 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 --- src/server/game/Spells/Spell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6598a2af9..f04cb4a91 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -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() &&