Merge pull request #51881 from KoBeWi/zz__iinnddeexx

Fix z_index applied twice for TileMap layers
This commit is contained in:
Rémi Verschelde 2021-08-19 21:30:10 +02:00 committed by GitHub
commit 4f640762f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -782,7 +782,7 @@ void TileMap::_rendering_update_dirty_quadrants(SelfList<TileMapQuadrant>::List
// Get the tile data. // Get the tile data.
TileData *tile_data = Object::cast_to<TileData>(atlas_source->get_tile_data(c.get_atlas_coords(), c.alternative_tile)); TileData *tile_data = Object::cast_to<TileData>(atlas_source->get_tile_data(c.get_atlas_coords(), c.alternative_tile));
Ref<ShaderMaterial> mat = tile_data->tile_get_material(); Ref<ShaderMaterial> mat = tile_data->tile_get_material();
int z_index = layers[q.layer].z_index + tile_data->get_z_index(); int z_index = tile_data->get_z_index();
// Quandrant pos. // Quandrant pos.
Vector2 position = map_to_world(q.coords * get_effective_quadrant_size(q.layer)); Vector2 position = map_to_world(q.coords * get_effective_quadrant_size(q.layer));