aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Movement/Waypoints/WaypointManager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp
index 2820c5dee17..21af63868db 100644
--- a/src/server/game/Movement/Waypoints/WaypointManager.cpp
+++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp
@@ -78,6 +78,7 @@ void WaypointMgr::Load()
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);
+ delete wp;
continue;
}
@@ -134,13 +135,14 @@ void WaypointMgr::ReloadPath(uint32 id)
wp->z = z;
wp->orientation = o;
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);
+ delete wp;
continue;
}
-
+
wp->delay = fields[6].GetUInt32();
wp->event_id = fields[7].GetUInt32();
wp->event_chance = fields[8].GetUInt8();