From 34fc1699847fa4e477a50a617ad2157a976ca969 Mon Sep 17 00:00:00 2001 From: SX <50966843+S-S-X@users.noreply.github.com> Date: Mon, 31 May 2021 03:35:15 +0300 Subject: [PATCH] Compatibility hack for pre 5.3 engine (#181) --- technic_chests/inventory.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/technic_chests/inventory.lua b/technic_chests/inventory.lua index 82b75f1a..d338b7d6 100644 --- a/technic_chests/inventory.lua +++ b/technic_chests/inventory.lua @@ -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 @@ -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},