diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index 919f8a9e8e..15af30de5d 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -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); diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp index 5b864c7286..c3f1a447bd 100644 --- a/components/misc/resourcehelpers.cpp +++ b/components/misc/resourcehelpers.cpp @@ -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))