diff options
author | maximius <none@none> | 2009-09-19 12:13:08 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-09-19 12:13:08 -0700 |
commit | 0cf75ef9eaca43ebc9b7f8cde09428829989cf36 (patch) | |
tree | 24f56d1358b46ca0ad5dc513e3b1a3cdcd90bfb0 /src/game/WaypointManager.cpp | |
parent | 15d85229fae45405557aa6b706681dabaf854ed5 (diff) |
*Wintergrasp: Prevent defenders team to click the relic. Patch by Spp.
*Zum'Rah Area Trigger Script, Zum'Rah should become hostile when approached. By totoro.
*Judgement of Light PPM based, not 100%. By Drevi.
*Fix Deflection Exploit. By manuel, thanks to TheNecromancer and Gyullo.
*Correct Wintergrasp Tenacity formulas, by Gyullo.
*A Spirit Guide Escort Quest, code from SD2, patch by manuel.
*TrullyOne/MeanMachine Waypoint System Restored. Patch by XTElite1.
--HG--
branch : trunk
Diffstat (limited to 'src/game/WaypointManager.cpp')
-rw-r--r-- | src/game/WaypointManager.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp index a779641c1c1..b9fb027d9c5 100644 --- a/src/game/WaypointManager.cpp +++ b/src/game/WaypointManager.cpp @@ -24,12 +24,12 @@ #include "ProgressBar.h" #include "MapManager.h" -WaypointPathMap WaypointPathHolder; +UNORDERED_MAP<uint32, WaypointPath*> waypoint_map; WaypointStore WaypointMgr; void WaypointStore::Free() { - WaypointPathHolder.clear(); + waypoint_map.clear(); } void WaypointStore::Load() @@ -88,7 +88,7 @@ void WaypointStore::Load() path_data->push_back(wp); if(id != last_id) - WaypointPathHolder[id] = path_data; + waypoint_map[id] = path_data; last_id = id; @@ -99,16 +99,8 @@ void WaypointStore::Load() void WaypointStore::UpdatePath(uint32 id) { - // Prevent memory leak, deallocate allocated memory instead of just clearing from object holder - WaypointPathMap::iterator itr = WaypointPathHolder.find(id); - if(itr != WaypointPathHolder.end()) - { - for(WaypointPath::iterator jtr = WaypointPathHolder[id]->begin(); jtr != WaypointPathHolder[id]->end(); ++jtr) - { - delete (*jtr); - } - delete itr->second; - } + if(waypoint_map.find(id)!= waypoint_map.end()) + waypoint_map[id]->clear(); QueryResult *result; @@ -150,7 +142,7 @@ void WaypointStore::UpdatePath(uint32 id) } while (result->NextRow()); - WaypointPathHolder[id] = path_data; + waypoint_map[id] = path_data; delete result; } |