summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-11-16 08:49:26 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-11-16 08:49:26 -0300
commit0b1e93ccd43815d93de031b4f23fbfcd9ae7a34c (patch)
treed0d09cf6c744eb61438ed6ce775eafed22f5b4a1 /scene/2d
parent26d33d1c6eedf9271bac20a24ea37453c21ef890 (diff)
-Make sure monitorable cant be flipped while flushing queries, fixes #17330
-Also added set_deferred, this was missing.
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/area_2d.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp
index 48537f3cfc..ae5891fa50 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -399,7 +399,7 @@ void Area2D::set_monitoring(bool p_enable) {
if (p_enable == monitoring)
return;
if (locked) {
- ERR_EXPLAIN("Function blocked during in/out signal. Use call_deferred(\"set_monitoring\",true/false)");
+ ERR_EXPLAIN("Function blocked during in/out signal. Use set_deferred(\"monitoring\",true/false)");
}
ERR_FAIL_COND(locked);
@@ -424,10 +424,10 @@ bool Area2D::is_monitoring() const {
void Area2D::set_monitorable(bool p_enable) {
- if (locked) {
- ERR_EXPLAIN("This function can't be used during the in/out signal.");
+ if (locked || Physics2DServer::get_singleton()->is_flushing_queries()) {
+ ERR_EXPLAIN("Function blocked during in/out signal. Use set_deferred(\"monitorable\",true/false)");
}
- ERR_FAIL_COND(locked);
+ ERR_FAIL_COND(locked || Physics2DServer::get_singleton()->is_flushing_queries());
if (p_enable == monitorable)
return;