Skip to content

Commit

Permalink
cleaning up field declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
aschuhardt committed Aug 9, 2020
1 parent eaf7fae commit 81662d5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lua/src/script/environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 81662d5

Please sign in to comment.