better creative mode checks, fix crash when digging walls in MCL

This commit is contained in:
FaceDeer
2022-08-24 20:41:24 -06:00
parent 464f0f161b
commit 0cd2c9590f
9 changed files with 22 additions and 8 deletions

View File

@ -47,7 +47,7 @@ local punch_fix = function(pos, node, puncher, pointed_thing)
if wielded:get_name() == mese_crystal_node then
minetest.set_node(pos, {name="df_underworld_items:ancient_lantern_slade"})
minetest.get_node_timer(pos):stop()
if not (creative and creative.is_enabled_for and creative.is_enabled_for(puncher:get_player_name())) then
if not minetest.is_creative_enabled(puncher:get_player_name()) then
wielded:take_item()
puncher:set_wielded_item(wielded)
end

View File

@ -57,7 +57,9 @@ if invulnerable then
end
minetest.register_node("df_underworld_items:slade_brick", slade_brick_def)
local slade_wall_groups = {wall=1}
-- can't use "wall=1" because MCL has special handling for nodes in that group that explodes if it tries handling this one.
-- fortunately minetest_game walls also connect to group fence, so this should be fine.
local slade_wall_groups = {fence=1}
for key, val in pairs(slade_groups) do
slade_wall_groups[key]=val
end