From 5b8dde4b4a5a930e08da51e07ec87f43e5bd7b36 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 28 Nov 2018 18:40:58 -0300 Subject: [PATCH] Removed error that should not be an error, fixes #21088 --- scene/2d/area_2d.cpp | 4 +++- scene/3d/area.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index ae5891fa50d..4a4aaf3238d 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -158,7 +158,9 @@ void Area2D::_body_inout(int p_status, const RID &p_body, int p_instance, int p_ Map::Element *E = body_map.find(objid); - ERR_FAIL_COND(!body_in && !E); + if (!body_in && !E) { + return; //does not exist because it was likely removed from the tree + } locked = true; diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index 5e78368804d..ac77ddb7ce6 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -157,7 +157,9 @@ void Area::_body_inout(int p_status, const RID &p_body, int p_instance, int p_bo Map::Element *E = body_map.find(objid); - ERR_FAIL_COND(!body_in && !E); + if (!body_in && !E) { + return; //likely removed from the tree + } locked = true;