From b51dece762a8541764557fc0fcfd73f3736e4234 Mon Sep 17 00:00:00 2001 From: bjorn Date: Tue, 20 Aug 2019 00:54:42 -0700 Subject: [PATCH] Fix bug with permanent vectors; --- src/api/l_math.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api/l_math.c b/src/api/l_math.c index 8540c909..d4af6551 100644 --- a/src/api/l_math.c +++ b/src/api/l_math.c @@ -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); } } }