소스 검색

Removed unnecessary error from _area_inout

The error was previously removed from _body_inout
for the same reason. Fixes #28022.

(cherry picked from commit 8166f8d3c8259786d2c35db3eb47baedc6c4ce8b)
CatThingy 6 년 전
부모
커밋
4da40c39f1
2개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 2
      scene/2d/area_2d.cpp
  2. 3 1
      scene/3d/area.cpp

+ 3 - 2
scene/2d/area_2d.cpp

@@ -261,8 +261,9 @@ void Area2D::_area_inout(int p_status, const RID &p_area, int p_instance, int p_
 
 	Map<ObjectID, AreaState>::Element *E = area_map.find(objid);
 
-	ERR_FAIL_COND(!area_in && !E);
-
+	if (!area_in && !E) {
+		return; //likely removed from the tree
+	}
 	locked = true;
 
 	if (area_in) {

+ 3 - 1
scene/3d/area.cpp

@@ -356,7 +356,9 @@ void Area::_area_inout(int p_status, const RID &p_area, int p_instance, int p_ar
 
 	Map<ObjectID, AreaState>::Element *E = area_map.find(objid);
 
-	ERR_FAIL_COND(!area_in && !E);
+	if (!area_in && !E) {
+		return; //likely removed from the tree
+	}
 
 	locked = true;