aboutsummaryrefslogtreecommitdiff
path: root/src/game/WaypointManager.cpp
diff options
context:
space:
mode:
authorthenecromancer <none@none>2010-01-23 15:05:33 +0100
committerthenecromancer <none@none>2010-01-23 15:05:33 +0100
commit39ba392c7538db1bd18e617185c28420780e237c (patch)
treea620cd4b809816f697697af9478d6e538eb7cc5d /src/game/WaypointManager.cpp
parent76102c1cdd0fc8bb473f9b3fd3965cea5a3794f6 (diff)
parentd9cb0702158fd045285f2c0a904cb31a45a3864a (diff)
Merge
--HG-- branch : trunk
Diffstat (limited to 'src/game/WaypointManager.cpp')
-rw-r--r--src/game/WaypointManager.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp
index f4d14eb00d1..61d2b041092 100644
--- a/src/game/WaypointManager.cpp
+++ b/src/game/WaypointManager.cpp
@@ -34,7 +34,7 @@ void WaypointStore::Free()
void WaypointStore::Load()
{
- QueryResult *result = WorldDatabase.PQuery("SELECT COUNT(id) FROM waypoint_data");
+ QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT COUNT(id) FROM waypoint_data");
if (!result)
{
sLog.outError("an error occured while loading the table `waypoint_data` (maybe it doesn't exist ?)");
@@ -42,7 +42,6 @@ void WaypointStore::Load()
}
records = (*result)[0].GetUInt32();
- delete result;
result = WorldDatabase.PQuery("SELECT id,point,position_x,position_y,position_z,move_flag,delay,action,action_chance FROM waypoint_data ORDER BY id, point");
if(!result)
@@ -96,7 +95,6 @@ void WaypointStore::Load()
} while(result->NextRow()) ;
- delete result;
sLog.outString();
sLog.outString(">> Loaded %u waypoints", count);
}
@@ -106,7 +104,7 @@ void WaypointStore::UpdatePath(uint32 id)
if(waypoint_map.find(id)!= waypoint_map.end())
waypoint_map[id]->clear();
- QueryResult *result;
+ QueryResult_AutoPtr result;
result = WorldDatabase.PQuery("SELECT id,point,position_x,position_y,position_z,move_flag,delay,action,action_chance FROM waypoint_data WHERE id = %u ORDER BY point", id);
@@ -147,7 +145,5 @@ void WaypointStore::UpdatePath(uint32 id)
while (result->NextRow());
waypoint_map[id] = path_data;
-
- delete result;
}