Minor changes
This commit is contained in:
parent
4d0725e876
commit
baceba74b9
|
@ -144,7 +144,6 @@ CreaturePtr CreatureType::cast()
|
||||||
CreatureManager::CreatureManager()
|
CreatureManager::CreatureManager()
|
||||||
{
|
{
|
||||||
m_nullCreature = CreatureTypePtr(new CreatureType);
|
m_nullCreature = CreatureTypePtr(new CreatureType);
|
||||||
m_nullSpawn = SpawnPtr(new Spawn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureManager::clearSpawns()
|
void CreatureManager::clearSpawns()
|
||||||
|
@ -203,7 +202,7 @@ void CreatureManager::loadNpcs(const std::string& folder)
|
||||||
void CreatureManager::loadSpawns(const std::string& fileName)
|
void CreatureManager::loadSpawns(const std::string& fileName)
|
||||||
{
|
{
|
||||||
if(!isLoaded()) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,7 +335,7 @@ const CreatureTypePtr& CreatureManager::getCreatureByLook(int look)
|
||||||
return m_nullCreature;
|
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...
|
// TODO instead of a list, a map could do better...
|
||||||
auto findFun = [=] (const SpawnPtr& sp) -> bool
|
auto findFun = [=] (const SpawnPtr& sp) -> bool
|
||||||
|
@ -349,6 +348,6 @@ const SpawnPtr& CreatureManager::getSpawn(const Position& centerPos)
|
||||||
return *it;
|
return *it;
|
||||||
// Let it be debug so in release versions it shouldn't annoy the user
|
// 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)));
|
g_logger.debug(stdext::format("failed to find spawn at center %s",stdext::to_string(centerPos)));
|
||||||
return m_nullSpawn;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ public:
|
||||||
|
|
||||||
const CreatureTypePtr& getCreatureByName(std::string name);
|
const CreatureTypePtr& getCreatureByName(std::string name);
|
||||||
const CreatureTypePtr& getCreatureByLook(int look);
|
const CreatureTypePtr& getCreatureByLook(int look);
|
||||||
const SpawnPtr& getSpawn(const Position& centerPos);
|
SpawnPtr getSpawn(const Position& centerPos);
|
||||||
|
|
||||||
bool isLoaded() { return m_loaded; }
|
bool isLoaded() { return m_loaded; }
|
||||||
bool isSpawnLoaded() { return m_spawnLoaded; }
|
bool isSpawnLoaded() { return m_spawnLoaded; }
|
||||||
|
@ -127,7 +127,6 @@ private:
|
||||||
std::vector<SpawnPtr> m_spawns;
|
std::vector<SpawnPtr> m_spawns;
|
||||||
stdext::boolean<false> m_loaded, m_spawnLoaded;
|
stdext::boolean<false> m_loaded, m_spawnLoaded;
|
||||||
CreatureTypePtr m_nullCreature;
|
CreatureTypePtr m_nullCreature;
|
||||||
SpawnPtr m_nullSpawn;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CreatureManager g_creatures;
|
extern CreatureManager g_creatures;
|
||||||
|
|
Loading…
Reference in New Issue