ソースを参照

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;