diff options
author | Jordan Irwin <antumdeluge@gmail.com> | 2017-12-17 07:27:37 -0800 |
---|---|---|
committer | rubenwardy <rubenwardy@gmail.com> | 2017-12-17 15:27:37 +0000 |
commit | 18b921015a33c6e597f480bccc7e2974af33c4ea (patch) | |
tree | eb8a13a020e340870d772e72455cfcf3289504de /doc | |
parent | 26c7e98e3d87446acbc0c30b3c0ea8eb8bc1f6c5 (diff) | |
download | minetest-18b921015a33c6e597f480bccc7e2974af33c4ea.tar.gz minetest-18b921015a33c6e597f480bccc7e2974af33c4ea.tar.bz2 minetest-18b921015a33c6e597f480bccc7e2974af33c4ea.zip |
Allow 'default' parameter in 'settings:get_bool' function
Default value is used when the setting key is not found in the config
file. If default value is not set, 'nil' is returned.
#6188
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua_api.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index aba01fa1d..7d568b6e1 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -4131,7 +4131,9 @@ It can be created via `Settings(filename)`. #### Methods * `get(key)`: returns a value -* `get_bool(key)`: returns a boolean +* `get_bool(key, [default])`: returns a boolean + * `default` is the value returned if `key` is not found. + * Returns `nil` if `key` is not found and `default` not specified. * `get_np_group(key)`: returns a NoiseParams table * `set(key, value)` * Setting names can't contain whitespace or any of `="{}#`. |