mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Waypoints: Fixed memory leaks happening when loading waypoints with invalid move_type
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user