From 39e7b7110d019f3ca54d33d142d5692c55a80d8e Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Mon, 29 Nov 2021 21:00:06 -0500 Subject: [PATCH] fix null variable in check areas for balrog tool weapon * fixed and closed: https://codeberg.org/minenux/mobs_balrog/issues/3 --- init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 68965b4..32c556c 100755 --- a/init.lua +++ b/init.lua @@ -302,10 +302,11 @@ minetest.register_tool("mobs_balrog:balrog_whip", { local nodeu = minetest.get_node({x = new_pos.x, y = new_pos.y - 1, z = new_pos.z}) local value = x * x + z * z if value <= radius * radius + 1 - and node.name == "air" and nodeu.name ~= "air" - and not minetest.is_protected(new_pos, name) then - minetest.set_node(new_pos, {name = "fire:basic_flame"}) - break + and node.name == "air" and nodeu.name ~= "air" then + if not minetest.is_protected(new_pos, user:get_player_name()) then + minetest.set_node(new_pos, {name = "fire:basic_flame"}) + break + end end end end