diff --git a/src/api/l_graphics_buffer.c b/src/api/l_graphics_buffer.c index effdbdf8..20b0544a 100644 --- a/src/api/l_graphics_buffer.c +++ b/src/api/l_graphics_buffer.c @@ -265,7 +265,7 @@ void luax_readbufferdata(lua_State* L, int index, Buffer* buffer, char* data) { luaL_checktype(L, index, LUA_TTABLE); lovrCheck(info->fields, "Buffer must be created with format information to copy a table to it"); - if (info->fields[0].length > 0) { + if (info->fields[0].length == 0) { data = data ? data : lovrBufferMap(buffer, 0, info->size); luax_readbufferfield(L, index, info->fields, data); } else {