mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Be lenient with extra slashes for CSM paths
This commit is contained in:
parent
485b669840
commit
d961ece144
3 changed files with 12 additions and 3 deletions
|
@ -1881,8 +1881,17 @@ scene::IAnimatedMesh* Client::getMesh(const std::string &filename, bool cache)
|
|||
return mesh;
|
||||
}
|
||||
|
||||
const std::string* Client::getModFile(const std::string &filename)
|
||||
const std::string* Client::getModFile(std::string filename)
|
||||
{
|
||||
// strip dir delimiter from beginning of path
|
||||
auto pos = filename.find_first_of(':');
|
||||
if (pos == std::string::npos)
|
||||
return nullptr;
|
||||
pos++;
|
||||
auto pos2 = filename.find_first_not_of("/", pos);
|
||||
if (pos2 > pos)
|
||||
filename.erase(pos, pos2 - pos);
|
||||
|
||||
StringMap::const_iterator it = m_mod_vfs.find(filename);
|
||||
if (it == m_mod_vfs.end())
|
||||
return nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue