1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-02 12:33:52 +00:00

Fix bug with permanent vectors;

This commit is contained in:
bjorn 2019-08-20 00:54:42 -07:00
parent f91eed3834
commit b51dece762

View file

@ -59,9 +59,10 @@ float* luax_tovector(lua_State* L, int index, VectorType* type) {
return lovrPoolResolve(pool, v);
}
} else {
*type = *(VectorType*) p;
if (*type > V_NONE || *type < MAX_VECTOR_TYPES) {
return (float*) (type + 1);
VectorType* t = p;
if (*t > V_NONE && *t < MAX_VECTOR_TYPES) {
*type = *t;
return (float*) (t + 1);
}
}
}