Make use of ends_with for KF

7220-lua-add-a-general-purpose-lexical-parser
Alexei Kotov 2 years ago
parent e24db874dc
commit 6ff9b5d326

@ -609,7 +609,7 @@ namespace MWRender
{
std::string kfname = Misc::StringUtils::lowerCase(model);
if (kfname.size() > 4 && kfname.compare(kfname.size() - 4, 4, ".nif") == 0)
if (kfname.ends_with(".nif"))
kfname.replace(kfname.size() - 4, 4, ".kf");
addSingleAnimSource(kfname, baseModel);

@ -135,7 +135,7 @@ std::string Misc::ResourceHelpers::correctActorModelPath(const std::string& resP
else
mdlname.insert(mdlname.begin(), 'x');
std::string kfname = mdlname;
if (kfname.size() > 4 && kfname.compare(kfname.size() - 4, 4, ".nif") == 0)
if (kfname.ends_with(".nif"))
kfname.replace(kfname.size() - 4, 4, ".kf");
if (!vfs->exists(kfname))

Loading…
Cancel
Save