From df7f2e464afa034fa5667f0ba7c0e391a8e793fe Mon Sep 17 00:00:00 2001
From: BobFred7 <57379622+BobFred7@users.noreply.github.com>
Date: Wed, 13 May 2020 19:13:33 +0200
Subject: [PATCH] Alloy furnace: More realistic recipe balance (#549)

---
 technic/machines/HV/quarry.lua |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua
index b6f9c14..9cf378f 100644
--- a/technic/machines/HV/quarry.lua
+++ b/technic/machines/HV/quarry.lua
@@ -60,6 +60,12 @@
 end
 
 local function quarry_receive_fields(pos, formname, fields, sender)
+	local player_name = sender:get_player_name()
+	if minetest.is_protected(pos, player_name) then
+		minetest.chat_send_player(player_name, "You are not allowed to edit this!")
+		minetest.record_protection_violation(pos, player_name)
+		return
+	end
 	local meta = minetest.get_meta(pos)
 	if fields.size and string.find(fields.size, "^[0-9]+$") then
 		local size = tonumber(fields.size)
@@ -129,7 +135,7 @@
 			vector.multiply(qdir, -radius))
 		local owner = meta:get_string("owner")
 		local nd = meta:get_int("dug")
-		while nd ~= diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) do
+		while nd < diameter*diameter * (quarry_dig_above_nodes+1+quarry_max_depth) do
 			local ry = math.floor(nd / (diameter*diameter))
 			local ndl = nd % (diameter*diameter)
 			if ry % 2 == 1 then

--
Gitblit v1.8.0