mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 17:06:40 +00:00
Use normalized path in ESM4 reader
This commit is contained in:
parent
74d699c502
commit
2ddc77138a
1 changed files with 7 additions and 5 deletions
|
@ -320,16 +320,18 @@ namespace ESM4
|
||||||
std::filesystem::path path = strings / (prefix + language + suffix);
|
std::filesystem::path path = strings / (prefix + language + suffix);
|
||||||
if (mVFS != nullptr)
|
if (mVFS != nullptr)
|
||||||
{
|
{
|
||||||
std::string vfsPath = Files::pathToUnicodeString(path);
|
VFS::Path::Normalized vfsPath(Files::pathToUnicodeString(path));
|
||||||
if (!mVFS->exists(vfsPath))
|
Files::IStreamPtr stream = mVFS->find(vfsPath);
|
||||||
|
|
||||||
|
if (stream == nullptr)
|
||||||
{
|
{
|
||||||
path = strings / (prefix + altLanguage + suffix);
|
path = strings / (prefix + altLanguage + suffix);
|
||||||
vfsPath = Files::pathToUnicodeString(path);
|
vfsPath = VFS::Path::Normalized(Files::pathToUnicodeString(path));
|
||||||
|
stream = mVFS->find(vfsPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mVFS->exists(vfsPath))
|
if (stream != nullptr)
|
||||||
{
|
{
|
||||||
const Files::IStreamPtr stream = mVFS->get(vfsPath);
|
|
||||||
buildLStringIndex(stringType, *stream);
|
buildLStringIndex(stringType, *stream);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue