various fixes

master
BuckarooBanzay 2020-03-07 19:30:45 +01:00
parent 330ec6bb49
commit 375b763a07
2 changed files with 3 additions and 3 deletions

View File

@ -48,13 +48,13 @@ local function activate_palm_scanner(pos, node, player)
minetest.swap_node(pos, node)
minetest.chat_send_player(name, "Access granted !")
mesecon.receptor_on(pos, scifi_nodes.get_switch_rules(node.param2))
mesecon.receptor_on(pos)
-- reset state
minetest.after(2, function()
node.name = "access_cards:palm_scanner_off"
minetest.swap_node(pos, node)
mesecon.receptor_off(pos, scifi_nodes.get_switch_rules(node.param2))
mesecon.receptor_off(pos)
end)
end

View File

@ -12,7 +12,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
local stack = player:get_wielded_item()
if not starts_with(stack:get_name(), "access_cards") then
if not starts_with(stack:get_name(), "access_cards") or not fields.name then
-- not an access card
return
end