From a7ace9fec13a984ef50c861aaa890ad2f5c7d4b4 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 19 Aug 2021 12:40:09 +0200 Subject: [PATCH] Fix z_index applied twice for TileMap layers --- scene/2d/tile_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 74eb3f2fc2..12aa1afc45 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -782,7 +782,7 @@ void TileMap::_rendering_update_dirty_quadrants(SelfList::List // Get the tile data. TileData *tile_data = Object::cast_to(atlas_source->get_tile_data(c.get_atlas_coords(), c.alternative_tile)); Ref 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. Vector2 position = map_to_world(q.coords * get_effective_quadrant_size(q.layer));