Fix weirdness with vec2 scale arguments;

This commit is contained in:
bjorn 2022-04-06 10:10:27 -07:00
parent 8af8d7922a
commit 85ee89d36f
1 changed files with 5 additions and 2 deletions

View File

@ -80,11 +80,14 @@ int luax_readscale(lua_State* L, int index, vec3 v, int components, const char*
default: {
VectorType type;
float* u = luax_tovector(L, index++, &type);
if (type == V_VEC2 || type == V_VEC3) {
if (type == V_VEC2) {
v[0] = u[0];
v[1] = u[1];
v[2] = 1.f;
} else if (type == V_VEC3) {
vec3_init(v, u);
} else {
return luax_typeerror(L, index, "vec3, vec2, or number");
return luax_typeerror(L, index, "vec2, vec3, or number");
}
return index;
}