Fixed #21 Earth under torches oscillates between mud and grass
authorPerttu Ahola <celeron55@gmail.com>
Sat, 23 Jul 2011 17:22:22 +0000 (20:22 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 23 Jul 2011 17:22:22 +0000 (20:22 +0300)
src/environment.cpp

index f5e4b071a08aec49653c622cbad0a4569b5c10d7..d723696209c32a1cdee54e564ba1018898b416e5 100644 (file)
@@ -863,7 +863,7 @@ void ServerEnvironment::step(float dtime)
                                {
                                        if(myrand()%20 == 0)
                                        {
-                                               MapNode n_top = block->getNodeNoEx(p0+v3s16(0,1,0));
+                                               MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0));
                                                if(content_features(n_top).air_equivalent &&
                                                                n_top.getLightBlend(getDayNightRatio()) >= 13)
                                                {
@@ -879,9 +879,8 @@ void ServerEnvironment::step(float dtime)
                                {
                                        //if(myrand()%20 == 0)
                                        {
-                                               MapNode n_top = block->getNodeNoEx(p0+v3s16(0,1,0));
-                                               if(n_top.getContent() != CONTENT_AIR
-                                                               && n_top.getContent() != CONTENT_IGNORE)
+                                               MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0));
+                        if(content_features(n_top).air_equivalent == false)
                                                {
                                                        n.setContent(CONTENT_MUD);
                                                        m_map->addNodeWithEvent(p, n);