diff --git a/src/luaapi.c b/src/luaapi.c index 96916f3..fbcb5ab 100644 --- a/src/luaapi.c +++ b/src/luaapi.c @@ -1864,6 +1864,10 @@ static int dagame_draw(lua_State *L) { } else { lua_pop(L, 1); + lua_getfield(L, 1, "font"); + struct k3Font *font = *(void**) lua_touserdata(L, -1); + lua_pop(L, 1); + lua_getfield(L, 1, "align"); lua_getfield(L, 1, "r"); @@ -1878,9 +1882,6 @@ static int dagame_draw(lua_State *L) { lua_getfield(L, 1, "x"); lua_getfield(L, 1, "y"); - lua_getfield(L, 1, "font"); - struct k3Font *font = *(void**) lua_touserdata(L, 1); - struct k3RectF rect; k3FontSz(font, lua_tonumber(L, -4), lua_tostring(L, -3), &rect);