summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2017-08-28 05:51:55 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-08-28 07:51:55 +0200
commit04158d0c848b73bb9d4615c605fe51a180ba9d2c (patch)
tree1520244bcf205646f12d313ac6500b80901f5c73
parent520b4813832f3623f7b0b0408ecf26f36cda720b (diff)
downloadminetest-04158d0c848b73bb9d4615c605fe51a180ba9d2c.tar.gz
minetest-04158d0c848b73bb9d4615c605fe51a180ba9d2c.tar.bz2
minetest-04158d0c848b73bb9d4615c605fe51a180ba9d2c.zip
Use crack animation on all tile layers (#6104)
-rw-r--r--src/mapblock_mesh.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp
index 0980d6ecd..8fe00b052 100644
--- a/src/mapblock_mesh.cpp
+++ b/src/mapblock_mesh.cpp
@@ -684,17 +684,16 @@ void getNodeTileN(MapNode mn, v3s16 p, u8 tileindex, MeshMakeData *data, TileSpe
INodeDefManager *ndef = data->m_client->ndef();
const ContentFeatures &f = ndef->get(mn);
tile = f.tiles[tileindex];
- TileLayer *top_layer = NULL;
+ bool has_crack = p == data->m_crack_pos_relative;
for (TileLayer &layer : tile.layers) {
if (layer.texture_id == 0)
continue;
- top_layer = &layer;
if (!layer.has_color)
mn.getColor(f, &(layer.color));
+ // Apply temporary crack
+ if (has_crack)
+ layer.material_flags |= MATERIAL_FLAG_CRACK;
}
- // Apply temporary crack
- if (p == data->m_crack_pos_relative)
- top_layer->material_flags |= MATERIAL_FLAG_CRACK;
}
/*