Fix MCL crash during loading in jetpack.lua

This commit is contained in:
mrkubax10 2024-01-13 13:15:46 +01:00
parent 3db5fa322e
commit 4674f3b396

View File

@ -28,8 +28,10 @@ local function registerJetpack(config)
non_combat_torso=1, non_combat_torso=1,
_industrialtest_jetpack=1 _industrialtest_jetpack=1
} }
for key,value in pairs(config.groups) do if config.groups then
groups[key]=value for key,value in pairs(config.groups) do
groups[key]=value
end
end end
local definition={ local definition={
description=config.displayName, description=config.displayName,
@ -45,8 +47,10 @@ local function registerJetpack(config)
_mcl_armor_texture="industrialtest_"..config.name..".png", _mcl_armor_texture="industrialtest_"..config.name..".png",
_industrialtest_tryFly=config.tryFly _industrialtest_tryFly=config.tryFly
} }
for key,value in pairs(config.customKeys) do if config.customKeys then
definition[key]=value for key,value in pairs(config.customKeys) do
definition[key]=value
end
end end
minetest.register_tool("industrialtest:"..config.name,definition) minetest.register_tool("industrialtest:"..config.name,definition)
elseif industrialtest.mtgAvailable then elseif industrialtest.mtgAvailable then