libitem: Minor cleanup

This commit is contained in:
REDxEYE 2024-10-30 13:45:59 +03:00
parent a4b1b2100b
commit 3383566e6a

View File

@ -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;