mud gets now grass onto it when placed into sunlight. also removed three old files
authorPerttu Ahola <celeron55@gmail.com>
Tue, 15 Feb 2011 10:33:59 +0000 (12:33 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 15 Feb 2011 10:33:59 +0000 (12:33 +0200)
data/pauseMenu.gui [deleted file]
data/stone.png
data/water_old.png [deleted file]
src/map.cpp

diff --git a/data/pauseMenu.gui b/data/pauseMenu.gui
deleted file mode 100644 (file)
index 0cf6c7a..0000000
Binary files a/data/pauseMenu.gui and /dev/null differ
index c7a453e3f7be95a2dd091542441108ad05b1bca5..1d8aee9d59637b94c54ec9beff029bc3006e2de4 100644 (file)
Binary files a/data/stone.png and b/data/stone.png differ
diff --git a/data/water_old.png b/data/water_old.png
deleted file mode 100644 (file)
index 37b2898..0000000
Binary files a/data/water_old.png and /dev/null differ
index f4f1668c74e190ee05bdc455362ec5a7f73b42de..09cab79e25598197dd28daafa157fe80a2239504 100644 (file)
@@ -860,13 +860,11 @@ void Map::updateLighting(core::map<v3s16, MapBlock*> & a_blocks,
        The lighting value of the node should be left as-is after changing
        other values. This sets the lighting value to 0.
 */
-/*void Map::nodeAddedUpdate(v3s16 p, u8 lightwas,
-               core::map<v3s16, MapBlock*> &modified_blocks)*/
 void Map::addNodeAndUpdate(v3s16 p, MapNode n,
                core::map<v3s16, MapBlock*> &modified_blocks)
 {
        /*PrintInfo(m_dout);
-       m_dout<<DTIME<<"Map::nodeAddedUpdate(): p=("
+       m_dout<<DTIME<<"Map::addNodeAndUpdate(): p=("
                        <<p.X<<","<<p.Y<<","<<p.Z<<")"<<std::endl;*/
 
        /*
@@ -898,11 +896,12 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
        {
        }
        
-       if(n.d != CONTENT_TORCH)
+       /*
+               If the new node doesn't propagate sunlight and there is
+               grass below, change it to mud
+       */
+       if(content_features(n.d).sunlight_propagates == false)
        {
-               /*
-                       If there is grass below, change it to mud
-               */
                try{
                        MapNode bottomnode = getNode(bottompos);
                        
@@ -918,6 +917,19 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
                }
        }
 
+       /*
+               If the new node is mud and it is under sunlight, change it
+               to grass
+       */
+       if(n.d == CONTENT_MUD && node_under_sunlight)
+       {
+               n.d = CONTENT_GRASS;
+       }
+
+       /*
+               Remove all light that has come out of this node
+       */
+
        enum LightBank banks[] =
        {
                LIGHTBANK_DAY,
@@ -947,6 +959,10 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
 
                n.setLight(bank, 0);
        }
+
+       /*
+               Set the node on the map
+       */
        
        setNode(p, n);
        
@@ -975,7 +991,6 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
 
                        if(n2.getLight(LIGHTBANK_DAY) == LIGHT_SUN)
                        {
-                               //m_dout<<DTIME<<"doing"<<std::endl;
                                unLightNeighbors(LIGHTBANK_DAY,
                                                n2pos, n2.getLight(LIGHTBANK_DAY),
                                                light_sources, modified_blocks);
@@ -993,7 +1008,6 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
                
                /*
                        Spread light from all nodes that might be capable of doing so
-                       TODO: Convert to spreadLight
                */
                spreadLight(bank, light_sources, modified_blocks);
        }