Source pitchable flag defaults to true;

This commit is contained in:
bjorn 2023-07-10 20:09:16 -07:00
parent 74325d81a1
commit 5210d474b8
1 changed files with 3 additions and 3 deletions

View File

@ -239,7 +239,7 @@ static int l_lovrAudioNewSource(lua_State* L) {
Sound* sound = luax_totype(L, 1, Sound);
bool decode = false;
bool pitchable = false;
bool pitchable = true;
bool spatial = true;
uint32_t effects = ~0u;
if (lua_gettop(L) >= 2) {
@ -250,7 +250,7 @@ static int l_lovrAudioNewSource(lua_State* L) {
lua_pop(L, 1);
lua_getfield(L, 2, "pitchable");
pitchable = lua_toboolean(L, -1);
if (!lua_isnil(L, -1)) pitchable = lua_toboolean(L, -1);
lua_pop(L, 1);
lua_getfield(L, 2, "effects");
@ -273,7 +273,7 @@ static int l_lovrAudioNewSource(lua_State* L) {
lua_pop(L, 1);
lua_getfield(L, 2, "spatial");
spatial = lua_isnil(L, -1) ? true : lua_toboolean(L, -1);
if (!lua_isnil(L, -1)) spatial = lua_toboolean(L, -1);
lua_pop(L, 1);
}