Skip to content

Commit

Permalink
Allow TileMap physics/navigation to still work when hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
groud committed Oct 26, 2023
1 parent 46cb7f9 commit 9d90f17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/2d/tile_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ void TileMapLayer::_physics_update() {
const Ref<TileSet> &tile_set = tile_map_node->get_tileset();

// Check if we should cleanup everything.
bool forced_cleanup = in_destructor || !enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid() || !tile_map_node->is_visible_in_tree();
bool forced_cleanup = in_destructor || !enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid();
if (forced_cleanup) {
// Clean everything.
for (KeyValue<Vector2i, CellData> &kv : tile_map) {
Expand Down Expand Up @@ -902,7 +902,7 @@ void TileMapLayer::_navigation_update() {
NavigationServer2D *ns = NavigationServer2D::get_singleton();

// Check if we should cleanup everything.
bool forced_cleanup = in_destructor || !enabled || !navigation_enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid() || !tile_map_node->is_visible_in_tree();
bool forced_cleanup = in_destructor || !enabled || !navigation_enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid();

// ----------- Layer level processing -----------
if (forced_cleanup) {
Expand Down

0 comments on commit 9d90f17

Please sign in to comment.