Save houses and spawns fix

This commit is contained in:
BrunoDCC 2013-10-11 02:35:31 -03:00
parent 67bd00556d
commit de3160c90d
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);
}
std::string savePath = g_resources.getRealPath(fileName);
if(!doc.SaveFile(savePath))
stdext::throw_exception(stdext::format("failed to save spawns XML %s: %s", savePath, doc.ErrorDesc()));
if(!doc.SaveFile("data"+fileName))
stdext::throw_exception(stdext::format("failed to save spawns XML %s: %s", fileName, doc.ErrorDesc()));
} catch(std::exception& e) {
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);
}
std::string savePath = g_resources.getRealPath(fileName);
if(!doc.SaveFile(savePath))
stdext::throw_exception(stdext::format("failed to save houses XML %s: %s", savePath, doc.ErrorDesc()));
if(!doc.SaveFile("data"+fileName))
stdext::throw_exception(stdext::format("failed to save houses XML %s: %s", fileName, doc.ErrorDesc()));
} catch(std::exception& e) {
g_logger.error(stdext::format("Failed to save '%s': %s", fileName, e.what()));
}