1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Use ResourcePath for referencing texts and json's

This commit is contained in:
Ivan Savenko
2023-09-02 00:26:14 +03:00
parent 823ffa7a07
commit 6f0108e462
51 changed files with 124 additions and 130 deletions

View File

@@ -1717,12 +1717,13 @@ void CGameHandler::save(const std::string & filename)
logGlobal->info("Saving to %s", filename);
const auto stem = FileInfo::GetPathStem(filename);
const auto savefname = stem.to_string() + ".vsgm1";
CResourceHandler::get("local")->createResource(savefname);
ResourcePath savePath(stem.to_string(), EResType::SAVEGAME);
CResourceHandler::get("local")->createResource(savePath);
try
{
{
CSaveFile save(*CResourceHandler::get("local")->getResourceName(ResourcePath(stem.to_string(), EResType::SAVEGAME)));
CSaveFile save(*CResourceHandler::get("local")->getResourceName(savePath));
saveCommonState(save);
logGlobal->info("Saving server state");
save << *this;