Builtin: Change error to warning for light_source > 14
authorparamat <mat.gregory@virginmedia.com>
Wed, 21 Sep 2016 03:25:10 +0000 (04:25 +0100)
committerest31 <MTest31@outlook.com>
Wed, 21 Sep 2016 06:04:11 +0000 (08:04 +0200)
builtin/game/register.lua

index d3f6b3df89f69fb797dcf1dc989dd59cb7606dcd..90f095e9fc51f56be97875b78654051568a3c8ab 100644 (file)
@@ -128,7 +128,9 @@ function core.register_item(name, itemdef)
                        }
                end
                if itemdef.light_source and itemdef.light_source > core.LIGHT_MAX then
-                       error("Unable to register node: 'light_source' exceeds maximum: " .. name)
+                       itemdef.light_source = core.LIGHT_MAX
+                       core.log("warning", "Node 'light_source' value exceeds maximum," ..
+                               " limiting to maximum: " ..name)
                end
                setmetatable(itemdef, {__index = core.nodedef_default})
                core.registered_nodes[itemdef.name] = itemdef