summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2015-01-30 23:51:11 +0100
committerTim <t4im@users.noreply.github.com>2015-01-30 23:58:54 +0100
commit4dc3f159c9114d65571122909e252167579dc90b (patch)
tree7c892379e81f178a925abce99da1ee095f2756cf
parentf06534997286cfe123c9ead90e503f4270b12e75 (diff)
downloadpipeworks-4dc3f159c9114d65571122909e252167579dc90b.tar
pipeworks-4dc3f159c9114d65571122909e252167579dc90b.tar.gz
pipeworks-4dc3f159c9114d65571122909e252167579dc90b.tar.bz2
pipeworks-4dc3f159c9114d65571122909e252167579dc90b.tar.xz
pipeworks-4dc3f159c9114d65571122909e252167579dc90b.zip
remove unnecessary pcall() around tonumber, as it will return nil for invalid input and not throw an exception
-rw-r--r--vacuum_tubes.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/vacuum_tubes.lua b/vacuum_tubes.lua
index 1394a38..680e418 100644
--- a/vacuum_tubes.lua
+++ b/vacuum_tubes.lua
@@ -63,7 +63,7 @@ if pipeworks.enable_mese_sand_tube then
end,
on_receive_fields = function(pos,formname,fields,sender)
local meta = minetest.get_meta(pos)
- local _, dist = pcall(tonumber, fields.dist)
+ local dist = tonumber(fields.dist)
if dist and 0 <= dist and dist <= 8 then
meta:set_int("dist", dist)
meta:set_string("infotext", ("Adjustable Vacuuming Pneumatic Tube Segment (%dm)"):format(dist))