fix(core/SMART_EVENT_LINK) - Seperation and clarification of "not found or invalid, skipped" (#22240)

This commit is contained in:
Ryan Turner
2025-06-17 20:14:45 +01:00
committed by GitHub
parent 31f466fa32
commit 84533758f9

View File

@@ -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 {} 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 {} 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, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link);
}
}