1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

-Make sure monitorable cant be flipped while flushing queries, fixes #17330

-Also added set_deferred, this was missing.
This commit is contained in:
Juan Linietsky
2018-11-16 08:49:26 -03:00
parent 26d33d1c6e
commit 0b1e93ccd4
12 changed files with 69 additions and 8 deletions

View File

@@ -290,7 +290,7 @@ void Area::_notification(int p_what) {
void Area::set_monitoring(bool p_enable) {
if (locked) {
ERR_EXPLAIN("This function can't be used during the in/out signal.");
ERR_EXPLAIN("Function blocked during in/out signal. Use set_deferred(\"monitoring\",true/false)");
}
ERR_FAIL_COND(locked);
@@ -437,10 +437,10 @@ Array Area::get_overlapping_bodies() const {
void Area::set_monitorable(bool p_enable) {
if (locked) {
ERR_EXPLAIN("This function can't be used during the in/out signal.");
if (locked || PhysicsServer::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 || PhysicsServer::get_singleton()->is_flushing_queries());
if (p_enable == monitorable)
return;