]> git.lizzy.rs Git - minetest.git/blobdiff - src/mapblock_mesh.cpp
Fix some "Conditional jump or move depends on uninitialised value(s)" valgrind detections
[minetest.git] / src / mapblock_mesh.cpp
index c625983b059c906558ba97010ee61e63a6c68073..2bee572f04169c43221a22b3237d7fd60d17f10c 100644 (file)
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "map.h"
 #include "main.h" // For g_settings and g_texturesource
 #include "content_mapblock.h"
+#include "settings.h"
 
 void MeshMakeData::fill(u32 daynight_ratio, MapBlock *block)
 {
@@ -491,10 +492,10 @@ void updateFastFaceRow(
        
        u16 continuous_tiles_count = 0;
        
-       bool makes_face;
+       bool makes_face = false;
        v3s16 p_corrected;
        v3s16 face_dir_corrected;
-       u8 lights[4];
+       u8 lights[4] = {0,0,0,0};
        TileSpec tile;
        getTileInfo(blockpos_nodes, p, face_dir, daynight_ratio,
                        vmanip, temp_mods, smooth_lighting,
@@ -619,9 +620,9 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
        /*
                Some settings
        */
-       //bool new_style_water = g_settings.getBool("new_style_water");
-       //bool new_style_leaves = g_settings.getBool("new_style_leaves");
-       bool smooth_lighting = g_settings.getBool("smooth_lighting");
+       //bool new_style_water = g_settings->getBool("new_style_water");
+       //bool new_style_leaves = g_settings->getBool("new_style_leaves");
+       bool smooth_lighting = g_settings->getBool("smooth_lighting");
        
        /*
                We are including the faces of the trailing edges of the block.