diff --git a/src/client/creatures.cpp b/src/client/creatures.cpp index 7da7f613..5f8e9037 100644 --- a/src/client/creatures.cpp +++ b/src/client/creatures.cpp @@ -119,11 +119,14 @@ void Spawn::addCreature(const Position& placePos, const CreatureTypePtr& cType) { const Position& centerPos = getCenterPos(); int m_radius = getRadius(); - if(!isInZone(placePos, centerPos, m_radius)) - stdext::throw_exception(stdext::format("cannot place creature at %s %s %d (increment radius)", + if(!isInZone(placePos, centerPos, m_radius)) { + g_logger.warning(stdext::format("cannot place creature at %s (spawn's center position: %s, spawn radius: %d) (increment radius)", stdext::to_string(placePos), stdext::to_string(centerPos), m_radius )); + return; + } + g_map.addThing(cType->cast(), placePos, 4); m_creatures.insert(std::make_pair(placePos, cType)); } @@ -255,8 +258,9 @@ void CreatureManager::saveSpawns(const std::string& fileName) root->LinkEndChild(elem); } - if(!doc.SaveFile(fileName)) - stdext::throw_exception(stdext::format("failed to save spawns XML %s: %s", fileName, doc.ErrorDesc())); + std::string savePath = g_resources.getRealDir(fileName) + "/" + fileName; + if(!doc.SaveFile(savePath)) + stdext::throw_exception(stdext::format("failed to save spawns XML %s: %s", savePath, doc.ErrorDesc())); } void CreatureManager::loadCreatureBuffer(const std::string& buffer) diff --git a/src/client/houses.cpp b/src/client/houses.cpp index 4d67f3b9..f77653d7 100644 --- a/src/client/houses.cpp +++ b/src/client/houses.cpp @@ -173,8 +173,9 @@ void HouseManager::save(const std::string& fileName) root->LinkEndChild(elem); } - if(!doc.SaveFile(fileName)) - stdext::throw_exception(stdext::format("failed to save houses XML %s: %s", fileName, doc.ErrorDesc())); + std::string savePath = g_resources.getRealDir(fileName) + "/" + fileName; + if(!doc.SaveFile(savePath)) + stdext::throw_exception(stdext::format("failed to save houses XML %s: %s", savePath, doc.ErrorDesc())); } HouseList HouseManager::filterHouses(uint32 townId)