mirror of https://github.com/bjornbytes/lovr.git
newSource: typecheck second arg;
Errors when using old syntax instead of silently working/failing
This commit is contained in:
parent
e008dd2323
commit
e677006581
|
@ -222,7 +222,9 @@ static int l_lovrAudioNewSource(lua_State* L) {
|
|||
|
||||
bool spatial = true;
|
||||
bool decode = false;
|
||||
if (lua_istable(L, 2)) {
|
||||
if (lua_gettop(L) >= 2) {
|
||||
luaL_checktype(L, 2, LUA_TTABLE);
|
||||
|
||||
lua_getfield(L, 2, "spatial");
|
||||
spatial = lua_isnil(L, -1) || lua_toboolean(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
|
Loading…
Reference in New Issue