Skip to content

Commit

Permalink
Compatibility hack for pre 5.3 engine (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
S-S-X committed May 31, 2021
1 parent 96155ee commit 34fc169
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion technic_chests/inventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ local itemtypes = {
none = 4
}

-- Not so good compatibility workaround for older than 5.3 servers
local get_translated_string = minetest.get_translated_string or function(_, name) return name end

function technic.chests.sort_inv(inv, mode)
local list = inv:get_list("main")
if not list then return end
Expand Down Expand Up @@ -79,7 +82,7 @@ function technic.chests.sort_inv(inv, mode)
end
local lookup = {}
for _,stack in pairs(list) do
local key = minetest.get_translated_string('', name(stack))
local key = get_translated_string('', name(stack))
if not lookup[key] then
table.insert(unique_items, {
stacks = {stack},
Expand Down

0 comments on commit 34fc169

Please sign in to comment.