Merge pull request #64013 from smix8/nav_tilemap_parent_transform_error_3.x

This commit is contained in:
Rémi Verschelde 2022-08-06 22:22:30 +02:00 committed by GitHub
commit 45e42dfed3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<PosKey, Quadrant>::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;