mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 09:25:37 +02:00
Fix ObjectRef errors due to lua_isnil() (#10564)
Treat 'none' values as 'nil'
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user