Add cancel button to password change menu. (#5720)
[oweals/minetest.git] / src / nodedef.cpp
index ce2834c91fcd8701a5f6496d9992027d110610b1..966275076b026e2cc4f960016f60f2d70b3ac26d 100644 (file)
@@ -670,7 +670,6 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc
        }
 
        bool is_liquid = false;
-       bool is_water_surface = false;
 
        u8 material_type = (alpha == 255) ?
                TILE_MATERIAL_BASIC : TILE_MATERIAL_ALPHA;
@@ -733,35 +732,36 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc
                        for (u32 i = 0; i < 6; i++)
                                tdef[i].name += std::string("^[noalpha");
                }
-               if (waving == 1)
+               if (waving >= 1)
                        material_type = TILE_MATERIAL_WAVING_LEAVES;
                break;
        case NDT_PLANTLIKE:
                solidness = 0;
-               if (waving == 1)
+               if (waving >= 1)
                        material_type = TILE_MATERIAL_WAVING_PLANTS;
                break;
        case NDT_FIRELIKE:
                solidness = 0;
                break;
        case NDT_MESH:
+       case NDT_NODEBOX:
                solidness = 0;
+               if (waving == 1)
+                       material_type = TILE_MATERIAL_WAVING_PLANTS;
+               else if (waving == 2)
+                       material_type = TILE_MATERIAL_WAVING_LEAVES;
                break;
        case NDT_TORCHLIKE:
        case NDT_SIGNLIKE:
        case NDT_FENCELIKE:
        case NDT_RAILLIKE:
-       case NDT_NODEBOX:
                solidness = 0;
                break;
        }
 
-       if (is_liquid) {
+       if (is_liquid)
                material_type = (alpha == 255) ?
                        TILE_MATERIAL_LIQUID_OPAQUE : TILE_MATERIAL_LIQUID_TRANSPARENT;
-               if (name == "default:water_source")
-                       is_water_surface = true;
-       }
 
        // Vertex alpha is no longer supported, correct if necessary.
        correctAlpha();
@@ -772,11 +772,6 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc
                        material_type, drawtype);
        }
 
-       if (is_water_surface) {
-               tile_shader[0] = shdsrc->getShader("water_surface_shader",
-                       material_type, drawtype);
-       }
-
        // Tiles (fill in f->tiles[])
        for (u16 j = 0; j < 6; j++) {
                fillTileAttribs(tsrc, &tiles[j].layers[0], &tdef[j], tile_shader[j],