1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 07:45:39 +00:00

Invert condition

Rebased to account for upstream normalising slashes to replace forward
slashes with backslashes, simplifying the part that needed to check for
both variants. Perhaps if it'd been like that in the first place, I
wouldn't have made the mistake that made the original version of this
commit necessary.
This commit is contained in:
AnyOldName3 2023-08-14 14:10:45 +01:00
parent 575367bc18
commit f30676cbc7

View file

@ -72,8 +72,8 @@ std::string Misc::ResourceHelpers::correctResourcePath(std::string_view topLevel
bool needsPrefix = true;
for (std::string_view alternativeDirectory : alternativeDirectories)
{
if (!correctedPath.starts_with(alternativeDirectory) || correctedPath.size() <= alternativeDirectory.size()
|| correctedPath[alternativeDirectory.size()] != '\\')
if (correctedPath.starts_with(alternativeDirectory) && correctedPath.size() > alternativeDirectory.size()
&& correctedPath[alternativeDirectory.size()] == '\\')
{
needsPrefix = false;
break;