Merge pull request #69349 from reejk/tilemap-use-navigation-layer-layers

Use TileSet navigation layer layers when TileMap generates navigation polygons
This commit is contained in:
Rémi Verschelde 2022-12-21 22:27:40 +01:00
commit df4d827559
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1739,6 +1739,7 @@ void TileMap::_navigation_update_dirty_quadrants(SelfList<TileMapQuadrant>::List
NavigationServer2D::get_singleton()->region_set_owner_id(region, get_instance_id());
NavigationServer2D::get_singleton()->region_set_map(region, get_world_2d()->get_navigation_map());
NavigationServer2D::get_singleton()->region_set_transform(region, tilemap_xform * tile_transform);
NavigationServer2D::get_singleton()->region_set_navigation_layers(region, tile_set->get_navigation_layer_layers(layer_index));
NavigationServer2D::get_singleton()->region_set_navigation_polygon(region, navigation_polygon);
q.navigation_regions[E_cell].write[layer_index] = region;
}