mirror of
https://github.com/Sokomine/locks.git
synced 2024-11-13 05:40:16 +01:00
fixed bug with newer MT: aborting input with ESC works again
This commit is contained in:
parent
f050587a11
commit
1c4a406a93
4
init.lua
4
init.lua
|
@ -21,9 +21,10 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--]]
|
||||
|
||||
-- Version 1.15
|
||||
-- Version 1.16
|
||||
|
||||
-- Changelog:
|
||||
-- 17.12.2013 * aborting input with ESC is possible again
|
||||
-- 01.09.2013 * fixed bug in input sanitization
|
||||
-- 31.08.2013 * changed receipe for key to avoid crafting conflickt with screwdriver
|
||||
-- 10.07.2013 * removed a potential bug (now uses string:gmatch)
|
||||
|
@ -287,6 +288,7 @@ function locks:lock_handle_input( pos, formname, fields, player )
|
|||
|
||||
-- is this input the lock is supposed to handle?
|
||||
if( not( fields.locks_sent_lock_command )
|
||||
or (fields.quit and fields.quit==true)
|
||||
-- or not( fields.locks_sent_input )
|
||||
or fields.locks_sent_lock_command == "" ) then
|
||||
return;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
|
||||
-- allow aborting with ESC in newer Versions of MT again
|
||||
|
||||
-- a sign
|
||||
minetest.register_node("locks:shared_locked_sign_wall", {
|
||||
description = "Shared locked sign",
|
||||
|
@ -40,6 +42,11 @@ minetest.register_node("locks:shared_locked_sign_wall", {
|
|||
end,
|
||||
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
|
||||
-- abort if no input has been sent
|
||||
if( fields.quit ) then
|
||||
return;
|
||||
end
|
||||
|
||||
-- if the user already has the right to use this and did input text
|
||||
if( fields.text
|
||||
|
|
Loading…
Reference in New Issue
Block a user