aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2016-09-15 22:40:19 +0100
committerparamat <mat.gregory@virginmedia.com>2016-09-17 09:33:25 +0100
commit3aefa5d3ceaaa9299f42cc10921dec65fa53c5e0 (patch)
treebccc3be37d612d0f7c2e30aa9f3df117b7f1e4ab /src
parent297546af3d3b5b3a07a61ade041ad7c26e9a531d (diff)
downloadminetest-3aefa5d3ceaaa9299f42cc10921dec65fa53c5e0.tar.gz
minetest-3aefa5d3ceaaa9299f42cc10921dec65fa53c5e0.tar.bz2
minetest-3aefa5d3ceaaa9299f42cc10921dec65fa53c5e0.zip
Register.lua: Throw error if node 'light_source' > core.LIGHT_MAX
Add 'core.LIGHT_MAX = 14' to builtin/game/constants.lua with the intention to replace misplaced 'default.LIGHT_MAX = 14' in Minetest Game. Add comment in light.h requiring the constant be changed in both places. Add lighting bug warning to note in lua_api.txt. There are hundreds of mod uses of 15 which causes a lighting bug.
Diffstat (limited to 'src')
-rw-r--r--src/light.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/light.h b/src/light.h
index f49be4518..984e6d7c2 100644
--- a/src/light.h
+++ b/src/light.h
@@ -27,8 +27,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
// This directly sets the range of light.
-// Actually this is not the real maximum, and this is not the
-// brightest. The brightest is LIGHT_SUN.
+// Actually this is not the real maximum, and this is not the brightest, the
+// brightest is LIGHT_SUN.
+// If changed, this constant as defined in builtin/game/constants.lua must
+// also be changed.
#define LIGHT_MAX 14
// Light is stored as 4 bits, thus 15 is the maximum.
// This brightness is reserved for sunlight