From a6e075499b171905bdda180078d68292b489c5be Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 6 Oct 2024 16:24:15 +0200 Subject: [PATCH] Use normalize path in Animation::addAnimSource to change extension --- apps/openmw/mwrender/animation.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index dacf7076ec..d6cad42e39 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -28,16 +28,17 @@ #include #include #include + #include #include #include -#include - -#include #include +#include #include +#include +#include #include #include #include @@ -677,10 +678,10 @@ namespace MWRender void Animation::addAnimSource(std::string_view model, const std::string& baseModel) { - std::string kfname = Misc::StringUtils::lowerCase(model); + VFS::Path::Normalized kfname(model); - if (kfname.ends_with(".nif")) - kfname.replace(kfname.size() - 4, 4, ".kf"); + if (Misc::getFileExtension(kfname) == "nif") + kfname.changeExtension("kf"); addSingleAnimSource(kfname, baseModel);