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:
@ -15,6 +15,7 @@
|
||||
#include "CCompressedStream.h"
|
||||
|
||||
#include "CBinaryReader.h"
|
||||
#include "../texts/TextOperations.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
@ -240,6 +241,19 @@ void CArchiveLoader::extractToFolder(const std::string & outputSubFolder, const
|
||||
extractToFolder(outputSubFolder, *inputStream, entry, absolute);
|
||||
}
|
||||
|
||||
|
||||
std::string CArchiveLoader::getFullFileURI(const ResourcePath& resourceName) const
|
||||
{
|
||||
auto relativePath = TextOperations::Utf8TofilesystemPath(resourceName.getName());
|
||||
auto path = boost::filesystem::canonical(archive) / relativePath;
|
||||
return TextOperations::filesystemPathToUtf8(path);
|
||||
}
|
||||
|
||||
std::time_t CArchiveLoader::getLastWriteTime(const ResourcePath& resourceName) const
|
||||
{
|
||||
return boost::filesystem::last_write_time(archive);
|
||||
}
|
||||
|
||||
boost::filesystem::path createExtractedFilePath(const std::string & outputSubFolder, const std::string & entryName, bool absolute)
|
||||
{
|
||||
boost::filesystem::path extractionFolderPath = absolute ? outputSubFolder : VCMIDirs::get().userExtractedPath() / outputSubFolder;
|
||||
|
Reference in New Issue
Block a user