1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Make sure mod paths are always absolute

This commit is contained in:
sfan5 2025-01-09 13:15:36 +01:00
parent d0d7c11fe1
commit 903d13ffff
3 changed files with 8 additions and 4 deletions

View file

@ -167,6 +167,7 @@ std::map<std::string, ModSpec> getModsInPath(
mod_path.clear();
mod_path.append(path).append(DIR_DELIM).append(modname);
mod_path = fs::AbsolutePath(mod_path);
mod_virtual_path.clear();
// Intentionally uses / to keep paths same on different platforms
@ -174,7 +175,7 @@ std::map<std::string, ModSpec> getModsInPath(
ModSpec spec(modname, mod_path, part_of_modpack, mod_virtual_path);
parseModContents(spec);
result.insert(std::make_pair(modname, spec));
result[modname] = std::move(spec);
}
return result;
}