From 4674f3b396ad5b24bff0a6b05ab8b1b96a200628 Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Sat, 13 Jan 2024 13:15:46 +0100 Subject: [PATCH] Fix MCL crash during loading in jetpack.lua --- tools/jetpack.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/jetpack.lua b/tools/jetpack.lua index b2d940d..5062a93 100644 --- a/tools/jetpack.lua +++ b/tools/jetpack.lua @@ -28,8 +28,10 @@ local function registerJetpack(config) non_combat_torso=1, _industrialtest_jetpack=1 } - for key,value in pairs(config.groups) do - groups[key]=value + if config.groups then + for key,value in pairs(config.groups) do + groups[key]=value + end end local definition={ description=config.displayName, @@ -45,8 +47,10 @@ local function registerJetpack(config) _mcl_armor_texture="industrialtest_"..config.name..".png", _industrialtest_tryFly=config.tryFly } - for key,value in pairs(config.customKeys) do - definition[key]=value + if config.customKeys then + for key,value in pairs(config.customKeys) do + definition[key]=value + end end minetest.register_tool("industrialtest:"..config.name,definition) elseif industrialtest.mtgAvailable then