Browse Source

Removed error that should not be an error, fixes #21088

Juan Linietsky 6 years ago
parent
commit
5b8dde4b4a
2 changed files with 6 additions and 2 deletions
  1. 3 1
      scene/2d/area_2d.cpp
  2. 3 1
      scene/3d/area.cpp

+ 3 - 1
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<ObjectID, BodyState>::Element *E = body_map.find(objid);
 	Map<ObjectID, BodyState>::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;
 	locked = true;
 
 

+ 3 - 1
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<ObjectID, BodyState>::Element *E = body_map.find(objid);
 	Map<ObjectID, BodyState>::Element *E = body_map.find(objid);
 
 
-	ERR_FAIL_COND(!body_in && !E);
+	if (!body_in && !E) {
+		return; //likely removed from the tree
+	}
 
 
 	locked = true;
 	locked = true;