mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
fix crash when map is packaged in a zip mod
This commit is contained in:
@ -56,6 +56,18 @@ std::unordered_set<ResourcePath> CMappedFileLoader::getFilteredFiles(std::functi
|
||||
return foundID;
|
||||
}
|
||||
|
||||
std::string CMappedFileLoader::getFullFileURI(const ResourcePath& resourceName) const
|
||||
{
|
||||
return CResourceHandler::get()->getFullFileURI(fileList.at(resourceName));
|
||||
}
|
||||
|
||||
std::time_t CMappedFileLoader::getLastWriteTime(const ResourcePath& resourceName) const
|
||||
{
|
||||
return CResourceHandler::get()->getLastWriteTime(fileList.at(resourceName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
CFilesystemList::CFilesystemList()
|
||||
{
|
||||
}
|
||||
@ -176,7 +188,29 @@ bool CFilesystemList::removeLoader(ISimpleResourceLoader * loader)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string CFilesystemList::getFullFileURI(const ResourcePath& resourceName) const
|
||||
{
|
||||
for (const auto& loader : boost::adaptors::reverse(loaders))
|
||||
if (loader->existsResource(resourceName))
|
||||
return loader->getFullFileURI(resourceName);
|
||||
|
||||
throw std::runtime_error("Resource with name " + resourceName.getName() + " and type "
|
||||
+ EResTypeHelper::getEResTypeAsString(resourceName.getType()) + " wasn't found.");
|
||||
}
|
||||
|
||||
std::time_t CFilesystemList::getLastWriteTime(const ResourcePath& resourceName) const
|
||||
{
|
||||
for (const auto& loader : boost::adaptors::reverse(loaders))
|
||||
if (loader->existsResource(resourceName))
|
||||
return loader->getLastWriteTime(resourceName);
|
||||
|
||||
throw std::runtime_error("Resource with name " + resourceName.getName() + " and type "
|
||||
+ EResTypeHelper::getEResTypeAsString(resourceName.getType()) + " wasn't found.");
|
||||
}
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
Reference in New Issue
Block a user