remove unnecessary pcall() around tonumber, as it will return nil for invalid input and not throw an exception

This commit is contained in:
Tim 2015-01-30 23:51:11 +01:00
parent f065349972
commit 4dc3f159c9

@ -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))