diff --git a/src/api/api.c b/src/api/api.c index 773d4682..f2785717 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -649,6 +649,7 @@ int luax_readscale(lua_State* L, int index, vec3 v, int components, const char* } else if (components == -2) { // -2 is special and means "2 components: xy and z" v[0] = v[1] = luax_tofloat(L, index); v[2] = luax_optfloat(L, index, 1.f); + return index + 2; } else { v[0] = v[1] = v[2] = 1.f; for (int i = 0; i < components; i++) {