Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use crack animation on all tile layers (#6104)
  • Loading branch information
juhdanad authored and nerzhul committed Aug 28, 2017
1 parent 520b481 commit 04158d0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/mapblock_mesh.cpp
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit 04158d0

Please sign in to comment.