From ce34bf702adc02eec630cac7abbce16fcbabe9bd Mon Sep 17 00:00:00 2001 From: bjorn Date: Fri, 26 May 2023 16:47:58 -0700 Subject: [PATCH] Put back absindex in luax_checkstruct; I thought it was for error messages, it's for correctness. --- src/api/l_graphics_buffer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/l_graphics_buffer.c b/src/api/l_graphics_buffer.c index 1386aaa1..4c83d233 100644 --- a/src/api/l_graphics_buffer.c +++ b/src/api/l_graphics_buffer.c @@ -147,6 +147,7 @@ static void luax_tofield(lua_State* L, int index, FieldType type, void* data) { static void luax_checkstruct(lua_State* L, int index, const BufferField* field, char* data) { lovrCheck(lua_istable(L, index), "Expected table for struct data"); + index = index > 0 ? index : lua_gettop(L) + 1 + index; if (!field->children[0].name || luax_len(L, index) > 0) { for (uint32_t i = 0, j = 1; i < field->childCount; i++) {