Prevent !is_inside_world() error

This commit is contained in:
aidandavey 2025-11-07 19:42:21 +00:00
parent a300aac050
commit a2cee6504d
1 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,9 @@ void Terrain3DInstancer::_process_updates() {
return; return;
} }
IS_DATA_INIT(VOID); IS_DATA_INIT(VOID);
if (!_terrain->is_inside_tree()) {
return;
}
const Terrain3DData *data = _terrain->get_data(); const Terrain3DData *data = _terrain->get_data();
TypedArray<Vector2i> region_locations = data->get_region_locations(); TypedArray<Vector2i> region_locations = data->get_region_locations();
int mesh_count = _terrain->get_assets()->get_mesh_count(); int mesh_count = _terrain->get_assets()->get_mesh_count();