Add shared mods path to get_modpaths

...because the documentation implies it should be.
This commit is contained in:
j-r 2024-08-17 19:48:40 +02:00 committed by GitHub
parent b0ad9a6c33
commit 1fb49e9ca7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -675,6 +675,11 @@ int ModApiMainMenu::l_get_modpaths(lua_State *L)
ModApiMainMenu::l_get_modpath(L);
lua_setfield(L, -2, "mods");
std::string modpath = fs::RemoveRelativePathComponents(
porting::path_share + DIR_DELIM + "mods" + DIR_DELIM);
lua_pushstring(L, modpath.c_str());
lua_setfield(L, -2, "share");
for (const std::string &component : getEnvModPaths()) {
lua_pushstring(L, component.c_str());
lua_setfield(L, -2, fs::AbsolutePath(component).c_str());