aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2019-07-10 16:02:18 +0200
committerGiacomo Pozzoni <giacomopoz@gmail.com>2019-07-10 16:02:18 +0200
commite4c2bb4f1411f2db724a7cfcdc014013a63b37a5 (patch)
treeab7c0381a79181d64844e972ad888e6759080e69
parent7f63c504d5cf5a9ad2f3d77ff2c67ca9d7586dd5 (diff)
Core/ChatCommands: Fix .wp reload crash
-rw-r--r--src/server/game/Movement/Waypoints/WaypointManager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp
index 0323438a96f..b3f8815e067 100644
--- a/src/server/game/Movement/Waypoints/WaypointManager.cpp
+++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp
@@ -85,10 +85,6 @@ WaypointMgr* WaypointMgr::instance()
void WaypointMgr::ReloadPath(uint32 id)
{
- auto itr = _waypointStore.find(id);
- if (itr != _waypointStore.end())
- _waypointStore.erase(itr);
-
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_ID);
stmt->setUInt32(0, id);
@@ -132,7 +128,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