summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2013-11-15 00:54:17 -0500
committerShadowNinja <shadowninja@minetest.net>2013-11-15 00:54:17 -0500
commit2d8ff45d9a3bcc3a327544705724aadd7b89ceb8 (patch)
tree829143a5cf4e61db3d885e8577c1eb43b8fb59d9
parent6d31965b36b40da472b666d01db774c79fb4ab47 (diff)
Fix crash with invalid radius
-rw-r--r--technic/machines/HV/quarry.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/technic/machines/HV/quarry.lua b/technic/machines/HV/quarry.lua
index bf0cd09..a62be8f 100644
--- a/technic/machines/HV/quarry.lua
+++ b/technic/machines/HV/quarry.lua
@@ -20,7 +20,7 @@ end
local function quarry_receive_fields(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
- local size = tonumber(fields.size)
+ local size = tonumber(fields.size) or 0
if fields.toggle then
if meta:get_int("enabled") == 0 then
@@ -30,8 +30,7 @@ local function quarry_receive_fields(pos, formname, fields, sender)
end
end
- -- Smallest size is 2. Anything less is asking for trouble.
- -- Largest is 8. It is a matter of pratical node handling.
+ -- Smallest size is 2. Largest is 8.
size = math.max(size, 2)
size = math.min(size, 8)