From c14521cbd226073f1cf553e0f518863ce7f7e51a Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Sat, 2 Mar 2019 11:14:05 +0100 Subject: [PATCH] Quarry: Fix server freeze when max depth is reduced (#487) Endless loop if max-depth is changed but some quarries are below that new limit The old comparison (~=) did not account for that --- technic/machines/HV/quarry.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua index b6f9c14..1671c4e 100644 --- a/technic/machines/HV/quarry.lua +++ b/technic/machines/HV/quarry.lua @@ -129,7 +129,7 @@ local function quarry_run(pos, node) 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