fix: reducing number of push_changed load

This commit is contained in:
Sara Gerretsen 2026-04-19 23:18:03 +02:00
parent e46e152338
commit 8e1d16c038
2 changed files with 5 additions and 3 deletions

View file

@ -27,7 +27,7 @@ void TerrainModifier::_notification(int what) {
}
void TerrainModifier::push_changed(Rect2 area) {
if (this->terrain) {
if (this->terrain && is_inside_tree() && is_ready()) {
this->terrain->push_changed(area);
}
}

View file

@ -74,10 +74,9 @@ void TerrainModifierPath::_notification(int what) {
case NOTIFICATION_READY:
children_changed();
set_notify_transform(true);
update_bounds();
return;
case NOTIFICATION_TRANSFORM_CHANGED:
if (is_inside_tree()) {
if (is_inside_tree() && is_ready()) {
path_changed();
}
return;
@ -172,6 +171,9 @@ void TerrainModifierPath::path_changed() {
}
}
update_configuration_warnings();
if (!is_ready()) {
return;
}
if (!update_bounds()) {
push_changed(get_bounds());
}