1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00

fix crash when map is packaged in a zip mod

This commit is contained in:
kdmcser
2025-05-16 01:14:12 +08:00
parent 29207c0b0f
commit 5e4912d056
11 changed files with 94 additions and 11 deletions

View File

@ -198,4 +198,17 @@ std::unordered_map<ResourcePath, boost::filesystem::path> CFilesystemLoader::lis
return fileList;
}
std::string CFilesystemLoader::getFullFileURI(const ResourcePath& resourceName) const
{
auto filePath = getResourceName(resourceName);
auto path = boost::filesystem::canonical(*filePath);
return TextOperations::filesystemPathToUtf8(path);
}
std::time_t CFilesystemLoader::getLastWriteTime(const ResourcePath& resourceName) const
{
auto resourcePath = getResourceName(resourceName);
return boost::filesystem::last_write_time(*resourcePath);
}
VCMI_LIB_NAMESPACE_END