summaryrefslogtreecommitdiff
path: root/editor/plugins/tiles/tile_atlas_view.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/tiles/tile_atlas_view.cpp')
-rw-r--r--editor/plugins/tiles/tile_atlas_view.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp
index e98bd74b62..f21d5098d3 100644
--- a/editor/plugins/tiles/tile_atlas_view.cpp
+++ b/editor/plugins/tiles/tile_atlas_view.cpp
@@ -522,10 +522,10 @@ void TileAtlasView::_update_alternative_tiles_rect_cache() {
}
Vector3i TileAtlasView::get_alternative_tile_at_pos(const Vector2 p_pos) const {
- for (Map<Vector2, Map<int, Rect2i>>::Element *E_coords = alternative_tiles_rect_cache.front(); E_coords; E_coords = E_coords->next()) {
- for (Map<int, Rect2i>::Element *E_alternative = E_coords->value().front(); E_alternative; E_alternative = E_alternative->next()) {
- if (E_alternative->value().has_point(p_pos)) {
- return Vector3i(E_coords->key().x, E_coords->key().y, E_alternative->key());
+ for (const KeyValue<Vector2, Map<int, Rect2i>> &E_coords : alternative_tiles_rect_cache) {
+ for (const KeyValue<int, Rect2i> &E_alternative : E_coords.value) {
+ if (E_alternative.value.has_point(p_pos)) {
+ return Vector3i(E_coords.key.x, E_coords.key.y, E_alternative.key);
}
}
}