diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-07-27 12:09:32 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-07-27 12:09:32 +0200 |
| commit | 55eafa247d91e24bd59a369daa05b05d20334791 (patch) | |
| tree | d9cd3bfe6c7d63860916e8c1fdab28a009a33bb5 /src/server/game/Movement | |
| parent | 7a93e93c9f2afcef80034399ae6754abd1f77152 (diff) | |
| parent | 6699d969f3114b60109288caebee7b5d7d86b61e (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/authserver/Server/AuthSession.cpp
src/server/game/Server/WorldSocket.cpp
src/server/game/Server/WorldSocket.h
Diffstat (limited to 'src/server/game/Movement')
3 files changed, 45 insertions, 6 deletions
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index aee8c497247..8cde9876ca1 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -161,13 +161,28 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature* creature) if (node->orientation && node->delay) init.SetFacing(node->orientation); - init.SetWalk(!node->run); + switch (node->move_type) + { + case WAYPOINT_MOVE_TYPE_LAND: + init.SetAnimation(Movement::ToGround); + break; + case WAYPOINT_MOVE_TYPE_TAKEOFF: + init.SetAnimation(Movement::ToFly); + break; + case WAYPOINT_MOVE_TYPE_RUN: + init.SetWalk(false); + break; + case WAYPOINT_MOVE_TYPE_WALK: + init.SetWalk(true); + break; + } + init.Launch(); //Call for creature group update if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature) { - creature->SetWalk(!node->run); + creature->SetWalk(node->move_type != WAYPOINT_MOVE_TYPE_RUN); creature->GetFormation()->LeaderMoveTo(formationDest.x, formationDest.y, formationDest.z); } diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index f7cb147a148..2820c5dee17 100644 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -42,7 +42,7 @@ void WaypointMgr::Load() uint32 oldMSTime = getMSTime(); // 0 1 2 3 4 5 6 7 8 9 - QueryResult result = WorldDatabase.Query("SELECT id, point, position_x, position_y, position_z, orientation, move_flag, delay, action, action_chance FROM waypoint_data ORDER BY id, point"); + QueryResult result = WorldDatabase.Query("SELECT id, point, position_x, position_y, position_z, orientation, move_type, delay, action, action_chance FROM waypoint_data ORDER BY id, point"); if (!result) { @@ -73,7 +73,14 @@ void WaypointMgr::Load() wp->y = y; wp->z = z; wp->orientation = o; - wp->run = fields[6].GetBool(); + wp->move_type = fields[6].GetUInt32(); + + if (wp->move_type >= WAYPOINT_MOVE_TYPE_MAX) + { + TC_LOG_ERROR("sql.sql", "Waypoint %u in waypoint_data has invalid move_type, ignoring", wp->id); + continue; + } + wp->delay = fields[7].GetUInt32(); wp->event_id = fields[8].GetUInt32(); wp->event_chance = fields[9].GetInt16(); @@ -126,7 +133,14 @@ void WaypointMgr::ReloadPath(uint32 id) wp->y = y; wp->z = z; wp->orientation = o; - wp->run = fields[5].GetBool(); + wp->move_type = fields[5].GetUInt32(); + + if (wp->move_type >= WAYPOINT_MOVE_TYPE_MAX) + { + TC_LOG_ERROR("sql.sql", "Waypoint %u in waypoint_data has invalid move_type, ignoring", wp->id); + continue; + } + wp->delay = fields[6].GetUInt32(); wp->event_id = fields[7].GetUInt32(); wp->event_chance = fields[8].GetUInt8(); diff --git a/src/server/game/Movement/Waypoints/WaypointManager.h b/src/server/game/Movement/Waypoints/WaypointManager.h index 385f4809729..8e5dd1f64c7 100644 --- a/src/server/game/Movement/Waypoints/WaypointManager.h +++ b/src/server/game/Movement/Waypoints/WaypointManager.h @@ -21,13 +21,23 @@ #include <vector> +enum WaypointMoveType +{ + WAYPOINT_MOVE_TYPE_WALK, + WAYPOINT_MOVE_TYPE_RUN, + WAYPOINT_MOVE_TYPE_LAND, + WAYPOINT_MOVE_TYPE_TAKEOFF, + + WAYPOINT_MOVE_TYPE_MAX +}; + struct WaypointData { uint32 id; float x, y, z, orientation; uint32 delay; uint32 event_id; - bool run; + uint32 move_type; uint8 event_chance; }; |
