mirror of
https://github.com/minetest-mods/i3.git
synced 2024-12-26 10:50:42 +01:00
Fix compress/sort
This commit is contained in:
parent
99460530b6
commit
c30b69fd9c
6
init.lua
6
init.lua
@ -877,9 +877,10 @@ local function sort_itemlist(player, az)
|
||||
local count = stack:get_count()
|
||||
local empty = stack:is_empty()
|
||||
local meta = stack:get_meta():to_table()
|
||||
local wear = stack:get_wear() > 0
|
||||
|
||||
if not empty then
|
||||
if next(meta.fields) then
|
||||
if next(meta.fields) or wear then
|
||||
stack_meta[#stack_meta + 1] = stack
|
||||
else
|
||||
new_inv[#new_inv + 1] = sprintf("%s %u", name, count)
|
||||
@ -912,9 +913,10 @@ local function compress_items(player)
|
||||
local count = stack:get_count()
|
||||
local empty = stack:is_empty()
|
||||
local meta = stack:get_meta():to_table()
|
||||
local wear = stack:get_wear() > 0
|
||||
|
||||
if not empty then
|
||||
if next(meta.fields) then
|
||||
if next(meta.fields) or wear then
|
||||
stack_meta[#stack_meta + 1] = stack
|
||||
else
|
||||
new_inv[name] = new_inv[name] or 0
|
||||
|
Loading…
Reference in New Issue
Block a user