diff options
| author | Subv <subv2112@gmail.com> | 2014-07-25 19:04:38 -0500 |
|---|---|---|
| committer | Subv <subv2112@gmail.com> | 2014-07-25 19:05:25 -0500 |
| commit | b5d025938e78ade2033ed2ce23f6ece3a3c27d4d (patch) | |
| tree | af8328ce61bc88d6a1528efcd1b9710c5b5dba2c /src/server/game/Movement/Waypoints | |
| parent | a98737d5d97f3001f670020d71772ece1e1d917f (diff) | |
Core/Waypoints: Allow the table waypoint_data to use Takeoff and Land waypoints.
Diffstat (limited to 'src/server/game/Movement/Waypoints')
| -rw-r--r-- | src/server/game/Movement/Waypoints/WaypointManager.cpp | 20 | ||||
| -rw-r--r-- | src/server/game/Movement/Waypoints/WaypointManager.h | 12 |
2 files changed, 28 insertions, 4 deletions
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; }; |
