From 03bb4dab469ddc9e37f7412fa979a0829cb3c953 Mon Sep 17 00:00:00 2001
From: auouymous <5005204+auouymous@users.noreply.github.com>
Date: Fri, 11 Sep 2020 19:15:51 +0200
Subject: [PATCH] Protect self-contained injector formspec buttons (#568)

---
 technic/machines/other/injector.lua |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/technic/machines/other/injector.lua b/technic/machines/other/injector.lua
index 2bf85b6..fc3e3cd 100644
--- a/technic/machines/other/injector.lua
+++ b/technic/machines/other/injector.lua
@@ -117,6 +117,8 @@
 		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

--
Gitblit v1.8.0