From ebe436d2c28885597aa132d4901238ec8e5dd8a0 Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Wed, 10 Jul 2019 16:02:18 +0200 Subject: Core/ChatCommands: Fix .wp reload crash (cherry picked from commit e4c2bb4f1411f2db724a7cfcdc014013a63b37a5) --- src/server/game/Movement/Waypoints/WaypointManager.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index c38c8ae531d..16451671dec 100644 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -84,10 +84,6 @@ WaypointMgr* WaypointMgr::instance() void WaypointMgr::ReloadPath(uint32 id) { - auto itr = _waypointStore.find(id); - if (itr != _waypointStore.end()) - _waypointStore.erase(itr); - WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_ID); stmt->setUInt32(0, id); @@ -131,7 +127,9 @@ void WaypointMgr::ReloadPath(uint32 id) } while (result->NextRow()); - _waypointStore[id] = WaypointPath(id, std::move(values)); + WaypointPath& path = _waypointStore[id]; + path.id = id; + path.nodes = std::move(values); } WaypointPath const* WaypointMgr::GetPath(uint32 id) const -- cgit v1.2.3