diff options
author | megamage <none@none> | 2009-08-15 22:58:17 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-15 22:58:17 -0500 |
commit | 95a79b2815da4f374d8ffcd1fb5cf9ce41f6c50f (patch) | |
tree | 8cc28ab5fc92f008ca6e0080ce3d73eb06047a3c /src | |
parent | 9f3d1a4a3b86e7f97676580985c7d9668aa9daf1 (diff) |
*Restore the work of escortAI::AddWaypoint.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/base/escortAI.cpp | 16 | ||||
-rw-r--r-- | src/bindings/scripts/base/escortAI.h | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/bindings/scripts/base/escortAI.cpp b/src/bindings/scripts/base/escortAI.cpp index 52b398cd59c..2c9b968d281 100644 --- a/src/bindings/scripts/base/escortAI.cpp +++ b/src/bindings/scripts/base/escortAI.cpp @@ -293,6 +293,17 @@ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 Wait Escort_Waypoint t(id, x, y, z, WaitTimeMs); WaypointList.push_back(t); + + // i think SD2 no longer uses this function + ScriptWP = true; + /*PointMovement wp; + wp.m_uiCreatureEntry = me->GetEntry(); + wp.m_uiPointId = id; + wp.m_fX = x; + wp.m_fY = y; + wp.m_fZ = z; + wp.m_uiWaitTime = WaitTimeMs; + PointMovementMap[wp.m_uiCreatureEntry].push_back(wp);*/ } void npc_escortAI::FillPointMovementListForCreature() @@ -345,11 +356,16 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, return; } + if(!ScriptWP) // sd2 never adds wp in script, but tc does + { + if (!WaypointList.empty()) WaypointList.clear(); FillPointMovementListForCreature(); + } + if (WaypointList.empty()) { error_db_log("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint)"); diff --git a/src/bindings/scripts/base/escortAI.h b/src/bindings/scripts/base/escortAI.h index 90a99152b68..8ce82eb370a 100644 --- a/src/bindings/scripts/base/escortAI.h +++ b/src/bindings/scripts/base/escortAI.h @@ -31,7 +31,7 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI { public: explicit npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature), - IsBeingEscorted(false), IsOnHold(false), PlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), m_uiWPWaitTimer(2500), m_bIsReturning(false), m_bIsActiveAttacker(true), m_bIsRunning(false), DespawnAtEnd(true), DespawnAtFar(true), m_pQuestForEscort(NULL), m_bCanInstantRespawn(false), m_bCanReturnToStart(false) {} + IsBeingEscorted(false), IsOnHold(false), PlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), m_uiWPWaitTimer(2500), m_bIsReturning(false), m_bIsActiveAttacker(true), m_bIsRunning(false), DespawnAtEnd(true), DespawnAtFar(true), m_pQuestForEscort(NULL), m_bCanInstantRespawn(false), m_bCanReturnToStart(false), ScriptWP(false) {} ~npc_escortAI() {} // Pure Virtual Functions @@ -101,6 +101,7 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI bool CanMelee; bool DespawnAtEnd; bool DespawnAtFar; + bool ScriptWP; }; #endif |