Navigation Menu

Skip to content

Commit

Permalink
Document for api functions that rely on current_modname, that it does…
Browse files Browse the repository at this point in the history
…n't work when not loading mods
  • Loading branch information
est31 committed Apr 8, 2015
1 parent c758fd7 commit 0a41326
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/lua_api.txt
Expand Up @@ -439,7 +439,8 @@ the global `minetest.registered_*` tables.
* added to `minetest.registered_schematic` with the key of `schematic.name`
* if `schematic.name` is nil, the key is the returned ID
* if the schematic is loaded from a file, schematic.name is set to the filename
* the current mod path will be prepended to the schematic filename if it is a relative path
* if the function is called when loading the mod, and schematic.name is a relative path,
* then the current mod path will be prepended to the schematic filename

* `minetest.clear_registered_biomes()`
* clears all biomes currently registered
Expand Down Expand Up @@ -1667,7 +1668,7 @@ Helper functions

### Utilities

* `minetest.get_current_modname()`: returns a string
* `minetest.get_current_modname()`: returns the currently loading mod's name, when we are loading a mod
* `minetest.get_modpath(modname)`: returns e.g. `"/home/user/.minetest/usermods/modname"`
* Useful for loading additional `.lua` modules or static data from mod
* `minetest.get_modnames()`: returns a list of installed mods
Expand Down
1 change: 1 addition & 0 deletions src/script/lua_api/l_base.h
Expand Up @@ -40,6 +40,7 @@ class ModApiBase {
static Server* getServer(lua_State *L);
static Environment* getEnv(lua_State *L);
static GUIEngine* getGuiEngine(lua_State *L);
// When we are not loading the mod, this function returns "."
static std::string getCurrentModPath(lua_State *L);

// Get an arbitrary subclass of ScriptApiBase
Expand Down

0 comments on commit 0a41326

Please sign in to comment.