Return nil if device doesn't have that button

Functions `lh.isDown()` and `isTouched()` should return nil if device
doesn't have the queried button.
This commit is contained in:
Josip Miskovic 2022-02-14 17:42:09 +01:00 committed by Bjorn
parent 2e82dfce92
commit 2e5c529faf
1 changed files with 2 additions and 4 deletions

View File

@ -479,8 +479,7 @@ static int l_lovrHeadsetIsDown(lua_State* L) {
return 1;
}
}
lua_pushboolean(L, false);
return 1;
return 0;
}
static int l_lovrHeadsetWasPressed(lua_State* L) {
@ -521,8 +520,7 @@ static int l_lovrHeadsetIsTouched(lua_State* L) {
return 1;
}
}
lua_pushboolean(L, 1);
return false;
return 0;
}
static const int axisCounts[MAX_AXES] = {