mirror of
				https://github.com/mt-mods/pipeworks.git
				synced 2025-11-04 10:25:29 +01:00 
			
		
		
		
	remove unnecessary pcall() around tonumber, as it will return nil for invalid input and not throw an exception
This commit is contained in:
		@@ -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))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user