From 69ee7945d70e40c7953e9f587a8d0480db8eda86 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 20 Jan 2018 14:21:00 -0500 Subject: Fixing a bug where tilemap navigation would not be accurate after a tilemap exits and then re-enters the tree. Fixing a bug where deleting a tile and then querying navigation would result in an incorrect path if both happened within the same frame. --- scene/2d/tile_map.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scene/2d') diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 361d765c97..52263e2a1f 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -61,6 +61,7 @@ void TileMap::_notification(int p_what) { } pending_update = true; + _recreate_quadrants(); _update_dirty_quadrants(); RID space = get_world_2d()->get_space(); _update_quadrant_transform(); @@ -653,7 +654,7 @@ void TileMap::_make_quadrant_dirty(Map::Element *Q) { pending_update = true; if (!is_inside_tree()) return; - call_deferred("_update_dirty_quadrants"); + _update_dirty_quadrants(); } void TileMap::set_cellv(const Vector2 &p_pos, int p_tile, bool p_flip_x, bool p_flip_y, bool p_transpose) { -- cgit v1.2.3