From 81662d535ff5313757e9d2c15c28c15809d2ffa1 Mon Sep 17 00:00:00 2001 From: Addison Schuhardt Date: Sun, 9 Aug 2020 02:41:14 -0700 Subject: [PATCH] cleaning up field declaration --- lua/src/script/environment.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lua/src/script/environment.c b/lua/src/script/environment.c index 82d0e18..9095b94 100644 --- a/lua/src/script/environment.c +++ b/lua/src/script/environment.c @@ -13,18 +13,14 @@ procy_color_t get_color(lua_State* L, int index) { return procy_create_color(1.0F, 1.0F, 1.0F); } - float r; - float g; - float b; - lua_getfield(L, index, FLD_COLOR_R); - r = lua_tonumber(L, -1); + float r = lua_tonumber(L, -1); lua_getfield(L, index, FLD_COLOR_G); - g = lua_tonumber(L, -1); + float g = lua_tonumber(L, -1); lua_getfield(L, index, FLD_COLOR_B); - b = lua_tonumber(L, -1); + float b = lua_tonumber(L, -1); // pop color values lua_pop(L, 3);