punching keypad during operation with several cycles operation is aborted

compass top texture for mover
This commit is contained in:
rnd 2015-05-04 11:44:31 +02:00
parent 3f8eb0e5e4
commit d1fa861426
2 changed files with 13 additions and 2 deletions

View File

@ -337,7 +337,13 @@ end
local function check_keypad(pos,name) local function check_keypad(pos,name)
local meta = minetest.get_meta(pos); local meta = minetest.get_meta(pos);
local pass = meta:get_string("pass"); local pass = meta:get_string("pass");
if pass == "" then meta:set_int("count",meta:get_int("iter")); use_keypad(pos) return end if pass == "" then
if meta:get_int("count")<=0 then -- only accept new operation requests if idle
meta:set_int("count",meta:get_int("iter")); use_keypad(pos)
else meta:set_int("count",0); meta:set_string("infotext","operation aborted by user. punch to activate.") -- reset
end
return
end
pass = "" pass = ""
local form = local form =
"size[3,1]" .. -- width, height "size[3,1]" .. -- width, height
@ -576,7 +582,12 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
return return
end end
minetest.chat_send_player(name,"ACCESS GRANTED.") minetest.chat_send_player(name,"ACCESS GRANTED.")
meta:set_int("count",meta:get_int("iter"));use_keypad(pos)
if meta:get_int("count")<=0 then -- only accept new operation requests if idle
meta:set_int("count",meta:get_int("iter")); use_keypad(pos)
else meta:set_int("count",0); meta:set_string("infotext","operation aborted by user. punch to activate.") -- reset
end
return return
end end
end end

BIN
textures/compass_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B