diff --git a/src/environment.cpp b/src/environment.cpp index f1b1dae..b683332 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1100,6 +1100,7 @@ void ServerEnvironment::step(float dtime) v3s16 test_p; MapNode testnode; u8 water_found = 0; // 1 = flowing, 2 = source + bool ignore_found = false; for(s16 z=-max_d; water_found < 2 && z<=max_d; z++) { for(s16 x=-max_d; water_found < 2 && x<=max_d; x++) { test_p = temp_p + v3s16(x,0,z); @@ -1108,6 +1109,8 @@ void ServerEnvironment::step(float dtime) water_found = 2; }else if (testnode.getContent() == CONTENT_WATER) { water_found = 1; + }else if (testnode.getContent() == CONTENT_IGNORE) { + ignore_found = true; } } } @@ -1140,7 +1143,7 @@ void ServerEnvironment::step(float dtime) m_map->addNodeWithEvent(test_p,n); } } - }else{ + }else if (!ignore_found) { // revert to mud n.setContent(CONTENT_MUD); m_map->addNodeWithEvent(p,n); diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp index 9f56d2e..8c80ecb 100644 --- a/src/mapblock_mesh.cpp +++ b/src/mapblock_mesh.cpp @@ -365,13 +365,15 @@ u8 getSmoothLight(v3s16 p, v3s16 corner, VoxelManipulator &vmanip) p.Z += 1; for (u32 i=0; i<8; i++) { - MapNode n = vmanip.getNodeNoEx(p - dirs8[i]); + MapNode n = vmanip.getNodeRO(p - dirs8[i]); if ( content_features(n).param_type == CPT_LIGHT ) { dl += n.getLight(LIGHTBANK_DAY); nl += n.getLight(LIGHTBANK_NIGHT); light_count++; + if (content_features(n).light_source > 0) + ambient_occlusion -= 2.0; }else if (content_features(n).draw_type == CDT_CUBELIKE) { ambient_occlusion += 1.0; }else if (n.getContent() != CONTENT_IGNORE) { @@ -385,7 +387,7 @@ u8 getSmoothLight(v3s16 p, v3s16 corner, VoxelManipulator &vmanip) dl /= light_count; nl /= light_count; - if (ambient_occlusion > 4) { + if (ambient_occlusion > 4.0) { ambient_occlusion = (ambient_occlusion-4) * 0.4 + 1.0; dl /= ambient_occlusion; nl /= ambient_occlusion;