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
This commit is contained in:
Thomas Rudin 2019-03-02 11:14:05 +01:00 committed by SmallJoker
parent 4f78a69ffc
commit c14521cbd2

View File

@ -129,7 +129,7 @@ local function quarry_run(pos, node)
vector.multiply(qdir, -radius)) vector.multiply(qdir, -radius))
local owner = meta:get_string("owner") local owner = meta:get_string("owner")
local nd = meta:get_int("dug") 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 ry = math.floor(nd / (diameter*diameter))
local ndl = nd % (diameter*diameter) local ndl = nd % (diameter*diameter)
if ry % 2 == 1 then if ry % 2 == 1 then