Fix crash when entering a non-number for forcefield range

This commit is contained in:
ShadowNinja 2013-10-27 14:38:44 -04:00
parent 704925aa7b
commit cee65bdd2a

@ -68,7 +68,7 @@ end
local forcefield_receive_fields = function(pos, formname, fields, sender) local forcefield_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local range = fields.range local range = tonumber(fields.range) or 0
if fields.toggle then if fields.toggle then
if meta:get_int("enabled") == 1 then if meta:get_int("enabled") == 1 then