GenericCAO: Fix dark model below y = 0
authorparamat <paramat@users.noreply.github.com>
Wed, 26 Jul 2017 18:46:29 +0000 (19:46 +0100)
committerparamat <mat.gregory@virginmedia.com>
Sun, 30 Jul 2017 17:40:45 +0000 (18:40 +0100)
Move point at which light is sampled up to 0.5 nodes above foot level,
to avoid that point sometimes passing into the node below causing the
model to go dark.

src/content_cao.cpp

index 9930873535e8447608771e1cee64d3f461929507..771820cb09c1003cc5c1a61dab10d15b4f4b47bf 100644 (file)
@@ -946,7 +946,7 @@ void GenericCAO::updateLightNoCheck(u8 light_at_pos)
 
 v3s16 GenericCAO::getLightPosition()
 {
-       return floatToInt(m_position, BS);
+       return floatToInt(m_position + v3f(0, 0.5 * BS, 0), BS);
 }
 
 void GenericCAO::updateNodePos()