From 157a4cf18cb9c098f465b8baecd7d2cd5705f2dd Mon Sep 17 00:00:00 2001 From: Kahrl Date: Sat, 21 Jan 2012 00:11:44 +0100 Subject: Node placement / mineral / serialization / iron freq / node_dig callback - Node placement code moved to Lua - Mineral system removed (added default:stone_with_coal and default:stone_with_iron). - MapBlock and MapNode serialization updated. - Mapgen: Frequency of iron increased. - node_dig callback and related changes. --- src/environment.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/environment.cpp') diff --git a/src/environment.cpp b/src/environment.cpp index 3a294086c..7c2aef272 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -2057,7 +2057,9 @@ void ClientEnvironment::step(float dtime) MapNode n = m_map->getNode(p); light = n.getLightBlend(getDayNightRatio(), m_gamedef->ndef()); } - catch(InvalidPositionException &e) {} + catch(InvalidPositionException &e){ + light = blend_light(getDayNightRatio(), LIGHT_SUN, 0); + } player->updateLight(light); /* @@ -2104,7 +2106,6 @@ void ClientEnvironment::step(float dtime) if(m_active_object_light_update_interval.step(dtime, 0.21)) { // Update lighting - //u8 light = LIGHT_MAX; u8 light = 0; try{ // Get node at head @@ -2112,7 +2113,9 @@ void ClientEnvironment::step(float dtime) MapNode n = m_map->getNode(p); light = n.getLightBlend(getDayNightRatio(), m_gamedef->ndef()); } - catch(InvalidPositionException &e) {} + catch(InvalidPositionException &e){ + light = blend_light(getDayNightRatio(), LIGHT_SUN, 0); + } obj->updateLight(light); } } @@ -2203,7 +2206,9 @@ u16 ClientEnvironment::addActiveObject(ClientActiveObject *object) MapNode n = m_map->getNode(p); light = n.getLightBlend(getDayNightRatio(), m_gamedef->ndef()); } - catch(InvalidPositionException &e) {} + catch(InvalidPositionException &e){ + light = blend_light(getDayNightRatio(), LIGHT_SUN, 0); + } object->updateLight(light); } return object->getId(); -- cgit v1.2.3