diff options
author | thenecromancer <none@none> | 2010-01-23 15:05:33 +0100 |
---|---|---|
committer | thenecromancer <none@none> | 2010-01-23 15:05:33 +0100 |
commit | 39ba392c7538db1bd18e617185c28420780e237c (patch) | |
tree | a620cd4b809816f697697af9478d6e538eb7cc5d /src/game/PoolHandler.cpp | |
parent | 76102c1cdd0fc8bb473f9b3fd3965cea5a3794f6 (diff) | |
parent | d9cb0702158fd045285f2c0a904cb31a45a3864a (diff) |
Merge
--HG--
branch : trunk
Diffstat (limited to 'src/game/PoolHandler.cpp')
-rw-r--r-- | src/game/PoolHandler.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp index c2cb8045b81..15afb656805 100644 --- a/src/game/PoolHandler.cpp +++ b/src/game/PoolHandler.cpp @@ -350,7 +350,7 @@ PoolHandler::PoolHandler() void PoolHandler::LoadFromDB() { - QueryResult *result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template"); + QueryResult_AutoPtr result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template"); if (!result) { sLog.outString(">> Table pool_template is empty."); @@ -361,7 +361,6 @@ void PoolHandler::LoadFromDB() { Field *fields = result->Fetch(); max_pool_id = fields[0].GetUInt16(); - delete result; } mPoolTemplate.resize(max_pool_id + 1); @@ -392,8 +391,6 @@ void PoolHandler::LoadFromDB() } while (result->NextRow()); - delete result; - sLog.outString(); sLog.outString( ">> Loaded %u objects pools", count ); @@ -458,7 +455,6 @@ void PoolHandler::LoadFromDB() } while (result->NextRow()); sLog.outString(); sLog.outString( ">> Loaded %u creatures in pools", count ); - delete result; } // Gameobjects @@ -530,7 +526,6 @@ void PoolHandler::LoadFromDB() } while( result->NextRow() ); sLog.outString(); sLog.outString( ">> Loaded %u gameobject in pools", count ); - delete result; } // Pool of pools @@ -619,7 +614,6 @@ void PoolHandler::LoadFromDB() } } } - delete result; sLog.outString(); sLog.outString( ">> Loaded %u pools in mother pools", count ); @@ -629,7 +623,7 @@ void PoolHandler::LoadFromDB() // The initialize method will spawn all pools not in an event and not in another pool, this is why there is 2 left joins with 2 null checks void PoolHandler::Initialize() { - QueryResult *result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry FROM pool_template LEFT JOIN game_event_pool ON pool_template.entry=game_event_pool.pool_entry LEFT JOIN pool_pool ON pool_template.entry=pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL AND pool_pool.pool_id IS NULL"); + QueryResult_AutoPtr result = WorldDatabase.Query("SELECT DISTINCT pool_template.entry FROM pool_template LEFT JOIN game_event_pool ON pool_template.entry=game_event_pool.pool_entry LEFT JOIN pool_pool ON pool_template.entry=pool_pool.pool_id WHERE game_event_pool.pool_entry IS NULL AND pool_pool.pool_id IS NULL"); uint32 count=0; if (result) { @@ -647,7 +641,6 @@ void PoolHandler::Initialize() SpawnPool(pool_entry, 0, TYPEID_UNIT); count++; } while (result->NextRow()); - delete result; } sLog.outBasic("Pool handling system initialized, %u pools spawned.", count); |