Skip to content

Commit 397d449

Browse files
auouymousnumberZero
authored andcommitted
Use empty string for protection check if puncher or clicker is nil.
1 parent 29ec26a commit 397d449

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

mesecons_blinkyplant/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mesecon.register_node("mesecons_blinkyplant:blinky_plant", {
3333
},
3434
on_timer = on_timer,
3535
on_rightclick = function(pos, node, clicker)
36-
if minetest.is_protected(pos, clicker and clicker:get_player_name()) then
36+
if minetest.is_protected(pos, clicker and clicker:get_player_name() or "") then
3737
return
3838
end
3939

mesecons_delayer/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ local off_state = {
9393
wield_image = "mesecons_delayer_off_1.png",
9494
groups = off_groups,
9595
on_punch = function(pos, node, puncher)
96-
if minetest.is_protected(pos, puncher and puncher:get_player_name()) then
96+
if minetest.is_protected(pos, puncher and puncher:get_player_name() or "") then
9797
return
9898
end
9999

@@ -134,7 +134,7 @@ local on_state = {
134134
},
135135
groups = {bendy = 2, snappy = 1, dig_immediate = 2, not_in_creative_inventory = 1},
136136
on_punch = function(pos, node, puncher)
137-
if minetest.is_protected(pos, puncher and puncher:get_player_name()) then
137+
if minetest.is_protected(pos, puncher and puncher:get_player_name() or "") then
138138
return
139139
end
140140

mesecons_noteblock/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ minetest.register_node("mesecons_noteblock:noteblock", {
44
is_ground_content = false,
55
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
66
on_punch = function(pos, node, puncher) -- change sound when punched
7-
if minetest.is_protected(pos, puncher and puncher:get_player_name()) then
7+
if minetest.is_protected(pos, puncher and puncher:get_player_name() or "") then
88
return
99
end
1010

0 commit comments

Comments
 (0)