Fix after soft node overlays
authorDániel Juhász <juhdanad@gmail.com>
Fri, 21 Apr 2017 16:04:06 +0000 (18:04 +0200)
committersfan5 <sfan5@live.de>
Fri, 21 Apr 2017 17:18:09 +0000 (19:18 +0200)
This removes a segmentation fault and makes node meshes well colorized.

src/content_mapblock.cpp
src/wieldmesh.cpp

index 9f4223bac57b3f8298682b3a5642109d299c2fbd..6673e2bd9f9ca96309889fbd67091d8355b9cba1 100644 (file)
@@ -108,7 +108,7 @@ void MapblockMeshGenerator::drawQuad(v3f *coords, const v3s16 &normal)
                vertices[j].Pos = coords[j] + origin;
                vertices[j].Normal = normal2;
                if (data->m_smooth_lighting)
-                       vertices[j].Color = blendLight(coords[j]);
+                       vertices[j].Color = blendLightColor(coords[j]);
                else
                        vertices[j].Color = color;
                if (shade_face)
@@ -298,7 +298,7 @@ video::SColor MapblockMeshGenerator::blendLightColor(const v3f &vertex_pos)
 video::SColor MapblockMeshGenerator::blendLightColor(const v3f &vertex_pos,
        const v3f &vertex_normal)
 {
-       video::SColor color = blendLight(vertex_pos);
+       video::SColor color = blendLightColor(vertex_pos);
        if (!f->light_source)
                applyFacesShading(color, vertex_normal);
        return color;
index 2b23d9e023c43723181578d2f19259858df25746..8b1477bb7da9a830f1c631d498a6e6afffa1fc79 100644 (file)
@@ -438,7 +438,7 @@ void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)
                g_extrusion_mesh_cache->grab();
        }
 
-       scene::SMesh *mesh;
+       scene::SMesh *mesh = NULL;
 
        // If inventory_image is defined, it overrides everything else
        if (def.inventory_image != "") {