aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRat <none@none>2010-11-16 00:13:47 +0100
committerRat <none@none>2010-11-16 00:13:47 +0100
commit8bb215d938f2df2a4bb123474308d28d7f15824c (patch)
tree833985e661267900a1ba75667d3c5b3944dd2731
parent9abf7f98b3516c91cb589461d47f64788c666392 (diff)
Core/SmartAI: removed depricated WP_LOAD, small fix to run-walk states when escorting, fix for escort invoker range check if no targets set
--HG-- branch : trunk
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp5
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp6
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp12
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h2
4 files changed, 9 insertions, 16 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index f6aff7aee04..fbc0e563cd5 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -90,7 +90,8 @@ void SmartAI::UpdateDespawn(const uint32 diff)
void SmartAI::Reset()
{
- SetRun(true);
+ if (!HasEscortState(SMART_ESCORT_ESCORTING))//dont mess up escort movement after combat
+ SetRun(true);
GetScript()->OnReset();
}
@@ -413,7 +414,7 @@ bool SmartAI::IsEscortInvokerInRange()
}
}
}
- return false;
+ return true;//escort targets were not set, ignore range check
}
void SmartAI::MovepointReached(uint32 id)
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index c847bda9127..6e330105e07 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -835,12 +835,6 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u
CAST_AI(SmartAI, me->AI())->SetSwimm(e.action.setSwimm.swimm ? true : false);
break;
}
- case SMART_ACTION_WP_LOAD:
- {
- if (!me) return;
- uint32 entry = e.action.wpLoad.id;
- break;
- }
case SMART_ACTION_WP_START:
{
if (!IsSmart()) return;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 42e30cb2009..a4745f34555 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -657,13 +657,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
case SMART_ACTION_SUMMON_GO:
if (!IsGameObjectValid(e, e.action.summonGO.entry)) return false;
break;
- case SMART_ACTION_WP_LOAD:
- if (!sSmartWaypointMgr.GetPath(e.action.wpLoad.id))
- {
- sLog.outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpLoad.id);
- return false;
- }
- break;
case SMART_ACTION_ADD_ITEM:
case SMART_ACTION_REMOVE_ITEM:
if (!IsItemValid(e, e.action.item.entry)) return false;
@@ -688,6 +681,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
break;
case SMART_ACTION_WP_START:
{
+ if (!sSmartWaypointMgr.GetPath(e.action.wpStart.pathID))
+ {
+ sLog.outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID);
+ return false;
+ }
if (e.action.wpStart.quest && !IsQuestValid(e, e.action.wpStart.quest)) return false;
if (e.action.wpStart.reactState > REACT_AGGRESSIVE)
{
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index ba360171acb..755f7e946f1 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -397,7 +397,7 @@ enum SMART_ACTION
SMART_ACTION_ATTACK_START = 49, //
SMART_ACTION_SUMMON_GO = 50, // GameObjectID, DespawnTime in ms,
SMART_ACTION_KILL_UNIT = 51, //
- SMART_ACTION_WP_LOAD = 52, // pathID
+ //SMART_ACTION_WP_LOAD = 52, // pathID
SMART_ACTION_WP_START = 53, // run/walk, pathID, canRepeat, quest, despawntime, reactState
SMART_ACTION_WP_PAUSE = 54, // time
SMART_ACTION_WP_STOP = 55, // despawnTime, quest, fail?