summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2018-08-25 19:22:04 -0500
committercheapie <no-email-for-you@example.com>2018-08-25 19:22:04 -0500
commitd69e2c7295543435983c89a1277cec1d17fc9182 (patch)
treedf3d89ff942a47ddbbf8b82cf9894d5851c474c9
parentb614384133f704fccc67e3aa26cd9920dd7c16ec (diff)
downloadfirealarm-d69e2c7295543435983c89a1277cec1d17fc9182.tar
firealarm-d69e2c7295543435983c89a1277cec1d17fc9182.tar.gz
firealarm-d69e2c7295543435983c89a1277cec1d17fc9182.tar.bz2
firealarm-d69e2c7295543435983c89a1277cec1d17fc9182.tar.xz
firealarm-d69e2c7295543435983c89a1277cec1d17fc9182.zip
Fix crash when resetting protected pull station
-rw-r--r--firealarm_pullstation/init.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/firealarm_pullstation/init.lua b/firealarm_pullstation/init.lua
index b212ec8..daca96a 100644
--- a/firealarm_pullstation/init.lua
+++ b/firealarm_pullstation/init.lua
@@ -69,10 +69,9 @@ minetest.register_node(":firealarm:pullstation_on",{
local name = player:get_player_name()
minetest.chat_send_player(name,string.format("Position: %d,%d,%d",pos.x,pos.y,pos.z))
end,
- on_rightclick = function(pos,node,name)
- --local name = minetest.get_player_name(clicker)
- if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,"protection_bypass") then
- minetest.record_protection_violation(pos,name)
+ on_rightclick = function(pos,node,clicker)
+ if minetest.is_protected(pos,clicker) and not minetest.check_player_privs(clicker,"protection_bypass") then
+ minetest.record_protection_violation(pos,minetest.get_player_name(clicker))
minetest.chat_send_player(name,"You are not authorized to reset this pull station")
return
end