From baceba74b91196418f86ecc293b38e8197595055 Mon Sep 17 00:00:00 2001 From: otfallen Date: Wed, 19 Sep 2012 07:13:45 +0000 Subject: [PATCH] Minor changes --- src/otclient/creatures.cpp | 7 +++---- src/otclient/creatures.h | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/otclient/creatures.cpp b/src/otclient/creatures.cpp index bc6a1539..c9f8476c 100644 --- a/src/otclient/creatures.cpp +++ b/src/otclient/creatures.cpp @@ -144,7 +144,6 @@ CreaturePtr CreatureType::cast() CreatureManager::CreatureManager() { m_nullCreature = CreatureTypePtr(new CreatureType); - m_nullSpawn = SpawnPtr(new Spawn); } void CreatureManager::clearSpawns() @@ -203,7 +202,7 @@ void CreatureManager::loadNpcs(const std::string& folder) void CreatureManager::loadSpawns(const std::string& fileName) { if(!isLoaded()) { - g_logger.fatal("creatures aren't loaded yet to load spawns."); + g_logger.warning("creatures aren't loaded yet to load spawns."); return; } @@ -336,7 +335,7 @@ const CreatureTypePtr& CreatureManager::getCreatureByLook(int look) return m_nullCreature; } -const SpawnPtr& CreatureManager::getSpawn(const Position& centerPos) +SpawnPtr CreatureManager::getSpawn(const Position& centerPos) { // TODO instead of a list, a map could do better... auto findFun = [=] (const SpawnPtr& sp) -> bool @@ -349,6 +348,6 @@ const SpawnPtr& CreatureManager::getSpawn(const Position& centerPos) return *it; // Let it be debug so in release versions it shouldn't annoy the user g_logger.debug(stdext::format("failed to find spawn at center %s",stdext::to_string(centerPos))); - return m_nullSpawn; + return nullptr; } diff --git a/src/otclient/creatures.h b/src/otclient/creatures.h index 02ed7746..56fa5ede 100644 --- a/src/otclient/creatures.h +++ b/src/otclient/creatures.h @@ -111,7 +111,7 @@ public: const CreatureTypePtr& getCreatureByName(std::string name); const CreatureTypePtr& getCreatureByLook(int look); - const SpawnPtr& getSpawn(const Position& centerPos); + SpawnPtr getSpawn(const Position& centerPos); bool isLoaded() { return m_loaded; } bool isSpawnLoaded() { return m_spawnLoaded; } @@ -127,7 +127,6 @@ private: std::vector m_spawns; stdext::boolean m_loaded, m_spawnLoaded; CreatureTypePtr m_nullCreature; - SpawnPtr m_nullSpawn; }; extern CreatureManager g_creatures;