aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatan Shukry <matanshukry@gmail.com>2021-04-26 22:39:22 +0300
committerGitHub <noreply@github.com>2021-04-26 21:39:22 +0200
commit8b0de23d0e4b15fce8dc8c67f9512f76804d6439 (patch)
tree2c8f1d56d4273d4f312686a23c40de19f501114d /src
parente5ef64963415498bdc6b35e8a996abffb1255fff (diff)
Core/SAI: Don't clear stored pathid if it changed after processing waypoint events (#26334)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp5
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 1651c794412..09458097d77 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -242,14 +242,15 @@ void SmartAI::EndPath(bool fail)
if (fail)
return;
- GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, nullptr, _currentWaypointNode, GetScript()->GetPathId());
+ uint32 pathid = GetScript()->GetPathId();
+ GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, nullptr, _currentWaypointNode, pathid);
if (_repeatWaypointPath)
{
if (IsAIControlled())
StartPath(mRun, GetScript()->GetPathId(), _repeatWaypointPath);
}
- else
+ else if (pathid == GetScript()->GetPathId()) // if it's not the same pathid, our script wants to start another path; don't override it
GetScript()->SetPathId(0);
if (mDespawnState == 1)
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 0d6b1ae3f92..17556730255 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -1592,7 +1592,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (!sConversationDataStore->GetConversationTemplate(e.action.conversation.id))
{
- TC_LOG_ERROR("sql.sql", "SmartAIMgr: SMART_ACTION_TALK_CONVERSATION Entry " SI64FMTD " SourceType %u Event %u Action %u uses invalid entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.conversation.id);
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr: SMART_ACTION_CREATE_CONVERSATION Entry " SI64FMTD " SourceType %u Event %u Action %u uses invalid entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.conversation.id);
return false;
}