diff options
author | Beha <shacknetisp@mail.com> | 2017-04-15 11:28:52 -0400 |
---|---|---|
committer | Beha <shacknetisp@mail.com> | 2017-04-15 11:28:52 -0400 |
commit | f777f0b5253b41d023af0c3c6cbd37d3483484c9 (patch) | |
tree | f7e719a36eb12dce6dc98b9f7fefdd037b1c7606 | |
parent | 3b9cee8d5d8bee3b6028f49ee112243312eaa2a0 (diff) |
Failsafe check
-rw-r--r-- | init.lua | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -567,6 +567,9 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields) minetest.chat_send_player(sender:get_player_name(), "This elevator is not attached to a motor.") return true end + if not formspecs[sender:get_player_name()][2] or not formspecs[sender:get_player_name()][2][minetest.explode_textlist_event(fields.target).index] then + return true + end -- Locate our target elevator. local target = nil local selected_target = formspecs[sender:get_player_name()][2][minetest.explode_textlist_event(fields.target).index] |