Protect self-contained injector formspec buttons (#568)

Fixes #536.
This commit is contained in:
auouymous 2020-09-11 10:15:51 -07:00 committed by GitHub
parent d7336670f2
commit 03bb4dab46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -117,6 +117,8 @@ minetest.register_node("technic:injector", {
return inv:is_empty("main")
end,
on_receive_fields = function(pos, formanme, fields, sender)
if minetest.is_protected(pos, sender:get_player_name()) then return end
local meta = minetest.get_meta(pos)
if fields.mode_item then meta:set_string("mode", "single items") end
if fields.mode_stack then meta:set_string("mode", "whole stacks") end