mirror of
https://github.com/minetest/minetest.git
synced 2024-12-29 20:20:29 +01:00
Fix mods folder being read twice with RUN_IN_PLACE=1 (#15024)
This commit is contained in:
parent
b2f6a65bc9
commit
66b3db3601
@ -282,7 +282,7 @@ Package - content which is downloadable from the content db, may or may not be i
|
||||
```lua
|
||||
{
|
||||
mods = "/home/user/.minetest/mods",
|
||||
share = "/usr/share/minetest/mods",
|
||||
share = "/usr/share/minetest/mods", -- only provided when RUN_IN_PLACE=0
|
||||
|
||||
-- Custom dirs can be specified by the MINETEST_MOD_DIR env variable
|
||||
["/path/to/custom/dir"] = "/path/to/custom/dir",
|
||||
|
@ -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…
Reference in New Issue
Block a user