This commit is contained in:
rnd 2015-05-03 23:31:36 +02:00
parent 8c0e10c287
commit e47a2d5fa1

View File

@ -272,8 +272,9 @@ minetest.register_node("basic_machines:keypad", {
local function use_keypad(pos,name)
local meta = minetest.get_meta(pos);
if minetest.is_protected(pos, name) then meta:set_string("infotext", "Protection fail. reset."); meta:set_int("count",0) end
local meta = minetest.get_meta(pos);
local count = meta:get_int("count") or 0;
if count<=0 then return end; count = count - 1; meta:set_int("count",count);