aboutsummaryrefslogtreecommitdiff
path: root/src/script/common/helper.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-11-28 13:48:33 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-11-28 13:48:33 +0100
commiteb6aca8b4a67ef55108231e71ff29a18a29bf5ae (patch)
treef891914d25cae2cdaa24392381436a287340651e /src/script/common/helper.h
parent8de51dae97aa2fe6ea02e4cf437bfe2b2a38eb06 (diff)
parentf1d72d212a0661588be27003069abf4bd8092e55 (diff)
downloaddragonfireclient-eb6aca8b4a67ef55108231e71ff29a18a29bf5ae.tar.xz
Merged Minetest
Diffstat (limited to 'src/script/common/helper.h')
-rw-r--r--src/script/common/helper.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/script/common/helper.h b/src/script/common/helper.h
index d639d6e16..7a794dc9b 100644
--- a/src/script/common/helper.h
+++ b/src/script/common/helper.h
@@ -50,5 +50,8 @@ protected:
* @return read value from Lua or default value if nil
*/
template <typename T>
- static T readParam(lua_State *L, int index, const T &default_value);
+ static inline T readParam(lua_State *L, int index, const T &default_value)
+ {
+ return lua_isnoneornil(L, index) ? default_value : readParam<T>(L, index);
+ }
};