Use xnif if its xkf is present even if xnif isn't

7220-lua-add-a-general-purpose-lexical-parser
Alexei Kotov 2 years ago
parent d1c602ce85
commit 4d0788e016

@ -134,7 +134,11 @@ std::string Misc::ResourceHelpers::correctActorModelPath(const std::string& resP
mdlname.insert(mdlname.begin() + p + 1, 'x');
else
mdlname.insert(mdlname.begin(), 'x');
if (!vfs->exists(mdlname))
std::string kfname = mdlname;
if (kfname.size() > 4 && kfname.compare(kfname.size() - 4, 4, ".nif") == 0)
kfname.replace(kfname.size() - 4, 4, ".kf");
if (!vfs->exists(kfname))
{
return resPath;
}

@ -28,7 +28,8 @@ namespace Misc
std::string correctIconPath(std::string_view resPath, const VFS::Manager* vfs);
std::string correctBookartPath(std::string_view resPath, const VFS::Manager* vfs);
std::string correctBookartPath(std::string_view resPath, int width, int height, const VFS::Manager* vfs);
/// Use "xfoo.nif" instead of "foo.nif" if available
/// Use "xfoo.nif" instead of "foo.nif" if "xfoo.kf" is available
/// Note that if "xfoo.nif" is actually unavailable, we can't fall back to "foo.nif". :(
std::string correctActorModelPath(const std::string& resPath, const VFS::Manager* vfs);
std::string correctMeshPath(const std::string& resPath, const VFS::Manager* vfs);

Loading…
Cancel
Save