From f2d991505ef97c80c1667256ed6a641351885c05 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 3 Dec 2014 15:31:00 +0100 Subject: [PATCH] handle other Windows-specific path issues regarding OpenCS resources handling --- apps/opencs/model/world/resources.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/opencs/model/world/resources.cpp b/apps/opencs/model/world/resources.cpp index aeef59fe7..13c8df84d 100644 --- a/apps/opencs/model/world/resources.cpp +++ b/apps/opencs/model/world/resources.cpp @@ -3,6 +3,7 @@ #include #include +#include #include @@ -55,6 +56,7 @@ CSMWorld::Resources::Resources (const std::string& baseDirectory, UniversalId::T std::string file = iter->substr (baseSize+1); mFiles.push_back (file); + std::replace (file.begin(), file.end(), '\\', '/'); mIndex.insert (std::make_pair ( Misc::StringUtils::lowerCase (file), static_cast (mFiles.size())-1)); } @@ -90,6 +92,8 @@ int CSMWorld::Resources::searchId (const std::string& id) const { std::string id2 = Misc::StringUtils::lowerCase (id); + std::replace (id2.begin(), id2.end(), '\\', '/'); + std::map::const_iterator iter = mIndex.find (id2); if (iter==mIndex.end())