From c8466fa218b63c7f24c5f11b5b64b519af3170f5 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 20 Nov 2021 16:27:06 +0100 Subject: [PATCH] =?UTF-8?q?fix(Core/SmartScripts):=20SMART=5FACTION=5FACTI?= =?UTF-8?q?VATE=5FGOBJECT=20should=20not=20rese=E2=80=A6=20(#9178)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Core/SmartScripts): SMART_ACTION_ACTIVATE_GOBJECT should not reset loot state for doors. Fixes #8937 --- src/server/game/AI/SmartScripts/SmartScript.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 10c425cd8..290d7575f 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -790,12 +790,16 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { if (IsGameObject(*itr)) { + GameObject* go = (*itr)->ToGameObject(); + // Activate - // xinef: wtf is this shit? - (*itr)->ToGameObject()->SetLootState(GO_READY); - (*itr)->ToGameObject()->UseDoorOrButton(0, !!e.action.activateObject.alternative, unit); - LOG_DEBUG("sql.sql", "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject %s activated", - (*itr)->GetGUID().ToString().c_str()); + if (go->GetGoType() != GAMEOBJECT_TYPE_DOOR) + { + go->SetLootState(GO_READY); + } + + go->UseDoorOrButton(0, !!e.action.activateObject.alternative, unit); + LOG_DEBUG("sql.sql", "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject %s activated", go->GetGUID().ToString().c_str()); } }