From d1fa861426c59e7af3960a35b6a63ec75526ddc0 Mon Sep 17 00:00:00 2001 From: rnd Date: Mon, 4 May 2015 11:44:31 +0200 Subject: [PATCH] punching keypad during operation with several cycles operation is aborted compass top texture for mover --- mover.lua | 15 +++++++++++++-- textures/compass_top.png | Bin 0 -> 273 bytes 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 textures/compass_top.png diff --git a/mover.lua b/mover.lua index b0d3a65..1dcbe75 100644 --- a/mover.lua +++ b/mover.lua @@ -337,7 +337,13 @@ end local function check_keypad(pos,name) local meta = minetest.get_meta(pos); 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 = "" local form = "size[3,1]" .. -- width, height @@ -576,7 +582,12 @@ minetest.register_on_player_receive_fields(function(player,formname,fields) return end 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 end end diff --git a/textures/compass_top.png b/textures/compass_top.png new file mode 100644 index 0000000000000000000000000000000000000000..34d4aba7af8d14d83fac0d9fb98856cadfb731ae GIT binary patch literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sDEfH31!Z9ZwBAX}2Ry9>jA5L~c#`DCC7dx@v7EBhTTR(@@3 ziNv$wK%quY7sn6_|70Jdlpp6E7#XAs!vFA0;buIg@4G|{sA7xzM@Gy4Vi5_Sy&ES^w1D%$TG-j`>5%|&cnm7mDl3&hj%&`fR17CboFyt I=akR{0AemtI{*Lx literal 0 HcmV?d00001