mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-29 04:06:40 +00:00
Allow top-level prefix to be found in the middle of a path
This commit is contained in:
parent
4d0aece001
commit
db5a43db30
1 changed files with 11 additions and 0 deletions
|
@ -75,6 +75,17 @@ std::string Misc::ResourceHelpers::correctResourcePath(
|
||||||
needsPrefix = false;
|
needsPrefix = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string topLevelPrefix = std::string{ potentialTopLevelDirectory } + '\\';
|
||||||
|
size_t topLevelPos = correctedPath.find('\\' + topLevelPrefix);
|
||||||
|
if (topLevelPos != std::string::npos)
|
||||||
|
{
|
||||||
|
correctedPath.erase(0, topLevelPos + 1);
|
||||||
|
needsPrefix = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (needsPrefix)
|
if (needsPrefix)
|
||||||
correctedPath = std::string{ topLevelDirectories.front() } + '\\' + correctedPath;
|
correctedPath = std::string{ topLevelDirectories.front() } + '\\' + correctedPath;
|
||||||
|
|
Loading…
Reference in a new issue