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

remove original resource functionality

This commit is contained in:
Laserlicht
2024-08-28 23:44:31 +02:00
parent 70190ea1fe
commit f327224d45
5 changed files with 8 additions and 40 deletions

View File

@@ -66,19 +66,10 @@ CFilesystemList::~CFilesystemList()
std::unique_ptr<CInputStream> CFilesystemList::load(const ResourcePath & resourceName) const
{
if(resourceName.getOriginalResource())
{
for(const auto & loader : loaders)
if (loader->existsResource(resourceName))
return loader->load(resourceName);
}
else
{
// load resource from last loader that have it (last overridden version)
for(const auto & loader : boost::adaptors::reverse(loaders))
if (loader->existsResource(resourceName))
return loader->load(resourceName);
}
// load resource from last loader that have it (last overridden version)
for(const auto & loader : boost::adaptors::reverse(loaders))
if (loader->existsResource(resourceName))
return loader->load(resourceName);
throw std::runtime_error("Resource with name " + resourceName.getName() + " and type "
+ EResTypeHelper::getEResTypeAsString(resourceName.getType()) + " wasn't found.");