aboutsummaryrefslogtreecommitdiff
path: root/src/script/common/helper.h
diff options
context:
space:
mode:
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);
+ }
};