# By BrunoDCC
# Via BrunoDCC
* https://github.com/BrunoDCC/otclient:
  Save houses and spawns fix
This commit is contained in:
Ahmed Samy 2013-10-11 11:38:03 +02:00
commit f47ea05abc
2 changed files with 4 additions and 6 deletions

View File

@ -266,9 +266,8 @@ void CreatureManager::saveSpawns(const std::string& fileName)
root->LinkEndChild(elem); root->LinkEndChild(elem);
} }
std::string savePath = g_resources.getRealPath(fileName); if(!doc.SaveFile("data"+fileName))
if(!doc.SaveFile(savePath)) stdext::throw_exception(stdext::format("failed to save spawns XML %s: %s", fileName, doc.ErrorDesc()));
stdext::throw_exception(stdext::format("failed to save spawns XML %s: %s", savePath, doc.ErrorDesc()));
} catch(std::exception& e) { } catch(std::exception& e) {
g_logger.error(stdext::format("Failed to save '%s': %s", fileName, e.what())); g_logger.error(stdext::format("Failed to save '%s': %s", fileName, e.what()));
} }

View File

@ -178,9 +178,8 @@ void HouseManager::save(const std::string& fileName)
root->LinkEndChild(elem); root->LinkEndChild(elem);
} }
std::string savePath = g_resources.getRealPath(fileName); if(!doc.SaveFile("data"+fileName))
if(!doc.SaveFile(savePath)) stdext::throw_exception(stdext::format("failed to save houses XML %s: %s", fileName, doc.ErrorDesc()));
stdext::throw_exception(stdext::format("failed to save houses XML %s: %s", savePath, doc.ErrorDesc()));
} catch(std::exception& e) { } catch(std::exception& e) {
g_logger.error(stdext::format("Failed to save '%s': %s", fileName, e.what())); g_logger.error(stdext::format("Failed to save '%s': %s", fileName, e.what()));
} }