Core/ChatCommands: Fix .wp reload crash

(cherry picked from commit e4c2bb4f14)
This commit is contained in:
Giacomo Pozzoni
2019-07-10 16:02:18 +02:00
committed by Shauren
parent c77f57edbc
commit ebe436d2c2

View File

@@ -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