diff --git a/components/bsa/bsa_archive.cpp b/components/bsa/bsa_archive.cpp index e33f0ba49..bd61e0339 100644 --- a/components/bsa/bsa_archive.cpp +++ b/components/bsa/bsa_archive.cpp @@ -112,7 +112,13 @@ class DirArchive: public Ogre::FileSystemArchive } pathComparer comp(delimiter, copy.size() - delimiter-1); - return std::binary_search(current.begin(), current.end(), copy, comp); + std::vector::iterator find = std::lower_bound(current.begin(), current.end(), copy, comp); + if (find != current.end() && !comp(copy, current.front())) + { + copy = *find; + return true; + } + return false; } public: