mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix mods folder being read twice with RUN_IN_PLACE=1 (#15024)
This commit is contained in:
parent
b2f6a65bc9
commit
66b3db3601
2 changed files with 7 additions and 5 deletions
|
@ -675,10 +675,12 @@ 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");
|
||||
if (porting::path_share != porting::path_user) {
|
||||
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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue