diff options
| author | ccrs <ccrs@users.noreply.github.com> | 2017-11-06 22:19:23 +0100 |
|---|---|---|
| committer | ccrs <ccrs@users.noreply.github.com> | 2017-11-06 22:19:23 +0100 |
| commit | e10d7dd45cfc073c791cd5e5f3f964d14b37df3d (patch) | |
| tree | 04f695772c2b253fbde2fde6511465b776e1e104 /src/server/scripts/Commands | |
| parent | d7de84b0277699fa12776864906e393f414aee08 (diff) | |
Core/Misc: waypoint movement
- Creature: update current waypoint to store nodeId and pathId
- MotionMaster: change variable type on GetMotionSlotType and GetMotionSlot to keep consistency and prevent errors (ASSERT is now no longer needed)
- UnitAI: add new waypoint hooks WaypointPathStarted and WaypointPathEnded
- SAI: handle WAYPOINT related events if creature is no escorting
* SMART_EVENT_WAYPOINT_RESUMED still not implemented for no escorting
TODO: the new hooks can save, now duplicated, logic on EscortAI and SAI
closes #20777
updates #20310
updates 21bd52cb99
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_wp.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 0b51b8b167c..a830a19bcea 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -2135,9 +2135,9 @@ public: float x, y, z; motionMaster->GetDestination(x, y, z); - for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i) + for (uint8 itr = 0; itr < MAX_MOTION_SLOT; ++itr) { - MovementGenerator* movementGenerator = motionMaster->GetMotionSlot(i); + MovementGenerator* movementGenerator = motionMaster->GetMotionSlot(MovementSlot(itr)); if (!movementGenerator) { handler->SendSysMessage("Empty"); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 609b4bd8918..582cc7b8c79 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -260,7 +260,7 @@ public: stmt->setUInt32(0, guildLow); WorldDatabase.Execute(stmt); - target->UpdateWaypointID(0); + target->UpdateCurrentWaypointInfo(0, 0); stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE); stmt->setUInt8(0, uint8(IDLE_MOTION_TYPE)); |
