if (!(HasEscortState(STATE_ESCORT_PAUSED))) // Only when paused
{
script_error_log("EscortAI for %s tried to set new waypoint %u, but not paused", m_creature->GetGuidStr().c_str(), uiPointId);
return;
}
if (!m_creature->GetMotionMaster()->SetNextWaypoint(uiPointId))
{
script_error_log("EscortAI for %s current waypoint tried to set to id %u, but doesn't exist in this path", m_creature->GetGuidStr().c_str(), uiPointId);
return;
}
}
voidnpc_escortAI::SetRun(bool bRun)
{
if (bRun)
{
if (!m_bIsRunning)
m_creature->SetWalk(false);
else
debug_log("SD2: EscortAI attempt to set run mode, but is already running.");
}
else
{
if (m_bIsRunning)
m_creature->SetWalk(true);
else
debug_log("SD2: EscortAI attempt to set walk mode, but is already walking.");
}
m_bIsRunning = bRun;
}
// TODO: get rid of this many variables passed in function.