From c962b6dd6d2f8a136096109378ea49045c50a866 Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Sun, 9 Apr 2017 18:31:46 +0200 Subject: [PATCH] Fix correctActorModelPath to work properly when both backward and forward slashes are used in the path (Fixes #3822) --- components/misc/resourcehelpers.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp index 6fe13abf3..5cf4378b8 100644 --- a/components/misc/resourcehelpers.cpp +++ b/components/misc/resourcehelpers.cpp @@ -127,9 +127,7 @@ std::string Misc::ResourceHelpers::correctBookartPath(const std::string &resPath std::string Misc::ResourceHelpers::correctActorModelPath(const std::string &resPath, const VFS::Manager* vfs) { std::string mdlname = resPath; - std::string::size_type p = mdlname.rfind('\\'); - if(p == std::string::npos) - p = mdlname.rfind('/'); + std::string::size_type p = mdlname.find_last_of("/\\"); if(p != std::string::npos) mdlname.insert(mdlname.begin()+p+1, 'x'); else