Fix crash when entering a non-number for forcefield range
authorShadowNinja <noreply@gmail.com>
Sun, 27 Oct 2013 18:38:44 +0000 (14:38 -0400)
committerShadowNinja <noreply@gmail.com>
Sun, 27 Oct 2013 18:39:45 +0000 (14:39 -0400)
technic/machines/HV/forcefield.lua

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