CRASHFIX: people (from mobile?) could crash the server triggering fields.key_down from the formspec

master
Zughy 2020-11-09 20:36:57 +01:00
parent b025bef7b6
commit a73602574f
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,8 @@ local S = minetest.get_translator("magic_compass")
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "magic_compass:GUI" then return end
if fields.EMPTY or fields.quit then return end
if fields.EMPTY or fields.quit or fields.key_up or fields.key_down then return end
local ID = string.match(dump(fields), "%d+")
local item = magic_compass.items[tonumber(ID)]