mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
libitem: Minor cleanup
This commit is contained in:
parent
a4b1b2100b
commit
3383566e6a
1 changed files with 4 additions and 8 deletions
|
|
@ -71,14 +71,10 @@ static int l_model_name(lua::State* L) {
|
|||
static int l_emission(lua::State* L) {
|
||||
if (auto def = get_item_def(L, 1)) {
|
||||
lua::createtable(L, 4, 0);
|
||||
lua::pushinteger(L, def->emission[0]);
|
||||
lua::rawseti(L, 1);
|
||||
lua::pushinteger(L, def->emission[1]);
|
||||
lua::rawseti(L, 2);
|
||||
lua::pushinteger(L, def->emission[2]);
|
||||
lua::rawseti(L, 3);
|
||||
lua::pushinteger(L, def->emission[3]);
|
||||
lua::rawseti(L, 4);
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
lua::pushinteger(L, def->emission[i]);
|
||||
lua::rawseti(L, i+1);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue