From 30d4555c6572746e5fc7aecc5272aa8ff0d47d55 Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Sat, 6 Aug 2022 21:39:38 +0200 Subject: [PATCH] Fix TileMap error msg when optional navigation node is not set Fixes TileMap error msg spam when bake_navigation=true but the optional and depr navigation node is not set. --- scene/2d/tile_map.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 4113ab68243..8b7f1dc6801 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -157,7 +157,11 @@ void TileMap::_update_quadrant_transform() { Transform2D nav_rel; if (bake_navigation) { - nav_rel = get_relative_transform_to_parent(navigation); + if (navigation) { + nav_rel = get_relative_transform_to_parent(navigation); + } else { + nav_rel = get_transform(); + } } for (Map::Element *E = quadrant_map.front(); E; E = E->next()) { @@ -339,7 +343,11 @@ void TileMap::update_dirty_quadrants() { Vector2 tofs = get_cell_draw_offset(); Transform2D nav_rel; if (bake_navigation) { - nav_rel = get_relative_transform_to_parent(navigation); + if (navigation) { + nav_rel = get_relative_transform_to_parent(navigation); + } else { + nav_rel = get_transform(); + } } Vector2 qofs;