From 84533758f9b0a545987fa89325be35f85fe180b9 Mon Sep 17 00:00:00 2001 From: Ryan Turner Date: Tue, 17 Jun 2025 20:14:45 +0100 Subject: [PATCH] fix(core/SMART_EVENT_LINK) - Seperation and clarification of "not found or invalid, skipped" (#22240) --- src/server/game/AI/SmartScripts/SmartScript.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 4b54ff788..cbccce1de 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3303,10 +3303,16 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (e.link && e.link != e.event_id) { auto linked = FindLinkedEvent(e.link); - if (linked.has_value() && linked.value().get().GetEventType() == SMART_EVENT_LINK) - executionStack.emplace_back(SmartScriptFrame{ linked.value(), unit, var0, var1, bvar, spell, gob }); + if (linked.has_value()) + { + auto& linkedEvent = linked.value().get(); + if (linkedEvent.GetEventType() == SMART_EVENT_LINK) + executionStack.emplace_back(SmartScriptFrame{ linkedEvent, unit, var0, var1, bvar, spell, gob }); + else + LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry {} SourceType {}, Event {}, Link Event {} found but has wrong type (should be 61, is {}).", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link, linkedEvent.GetEventType()); + } else - LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry {} SourceType {}, Event {}, Link Event {} not found or invalid, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link); + LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry {} SourceType {}, Event {}, Link Event {} not found, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link); } }