From 4dc3f159c9114d65571122909e252167579dc90b Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 30 Jan 2015 23:51:11 +0100 Subject: remove unnecessary pcall() around tonumber, as it will return nil for invalid input and not throw an exception --- vacuum_tubes.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) -- cgit v1.2.3