mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 12:26:59 +01:00
Fix TileMaps with origin offset placing NavPolygons wrong without a Navigation2D node
The legacy navigation was positioning baked TileMap navpolygons relative to the current Navigation2D node assuming that it is usually one of the parent nodes. Without the deprecated Navigation2D node the default navigation map of the world_2d is used. This navigation map has no relative Node2D so it needs to use the global_transform of the TileMap to place navregions with the correct offset in case the TileMap is moved from the origin.
This commit is contained in:
parent
182dbce670
commit
ec3d97dda5
@ -162,7 +162,7 @@ void RTileMap::_update_quadrant_transform() {
|
|||||||
if (navigation) {
|
if (navigation) {
|
||||||
nav_rel = get_relative_transform_to_parent(navigation);
|
nav_rel = get_relative_transform_to_parent(navigation);
|
||||||
} else {
|
} else {
|
||||||
nav_rel = get_transform();
|
nav_rel = get_global_transform();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ void RTileMap::update_dirty_quadrants() {
|
|||||||
if (navigation) {
|
if (navigation) {
|
||||||
nav_rel = get_relative_transform_to_parent(navigation);
|
nav_rel = get_relative_transform_to_parent(navigation);
|
||||||
} else {
|
} else {
|
||||||
nav_rel = get_transform();
|
nav_rel = get_global_transform();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user