mirror of https://github.com/bjornbytes/lovr.git
Fix weirdness with vec2 scale arguments;
This commit is contained in:
parent
8af8d7922a
commit
85ee89d36f
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue