summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-11-10 08:31:25 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-11-10 08:32:02 -0300
commit4deac219b0af86b7f80168920c8bedd070aa79c0 (patch)
tree46512ddff71cc4f58d30f571f4d0b401b824025b
parentfd4921375a10123b504b746914715d516aac1216 (diff)
Remove node from list before calling queries, fixes #10886
-rw-r--r--servers/physics_2d/space_2d_sw.cpp4
-rw-r--r--servers/physics_2d_server.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index f9febd1093..3b8eb19dd1 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -969,15 +969,15 @@ void Space2DSW::call_queries() {
while (state_query_list.first()) {
Body2DSW *b = state_query_list.first()->self();
- b->call_queries();
state_query_list.remove(state_query_list.first());
+ b->call_queries();
}
while (monitor_query_list.first()) {
Area2DSW *a = monitor_query_list.first()->self();
- a->call_queries();
monitor_query_list.remove(monitor_query_list.first());
+ a->call_queries();
}
}
diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp
index a5128c9435..650d3d0f62 100644
--- a/servers/physics_2d_server.cpp
+++ b/servers/physics_2d_server.cpp
@@ -529,7 +529,7 @@ void Physics2DServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("area_set_monitor_callback", "area", "receiver", "method"), &Physics2DServer::area_set_monitor_callback);
- ClassDB::bind_method(D_METHOD("body_create", "mode", "init_sleeping"), &Physics2DServer::body_create, DEFVAL(BODY_MODE_RIGID), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("body_create"), &Physics2DServer::body_create);
ClassDB::bind_method(D_METHOD("body_set_space", "body", "space"), &Physics2DServer::body_set_space);
ClassDB::bind_method(D_METHOD("body_get_space", "body"), &Physics2DServer::body_get_space);