summaryrefslogtreecommitdiff
path: root/scene/2d/collision_object_2d.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-30 20:08:33 +0200
committerGitHub <noreply@github.com>2019-08-30 20:08:33 +0200
commit4f6eb3610f70b2a73a19dd8b92fb03c4739ef25b (patch)
tree7ee151b1dfa30309d988aea4b6d8609db4a8e970 /scene/2d/collision_object_2d.cpp
parent9fc359411f6a65b318bafdbc7aa33c30c7e473ed (diff)
parentc902066bb5276d664dbd3c61cb5a3adf28ee6491 (diff)
Merge pull request #31805 from YeldhamDev/collision_object_unneeded_checks
Remove some unneeded checks in CollisionObject(2D)
Diffstat (limited to 'scene/2d/collision_object_2d.cpp')
-rw-r--r--scene/2d/collision_object_2d.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp
index 202c7c9cf2..228b67990c 100644
--- a/scene/2d/collision_object_2d.cpp
+++ b/scene/2d/collision_object_2d.cpp
@@ -376,11 +376,12 @@ void CollisionObject2D::set_only_update_transform_changes(bool p_enable) {
void CollisionObject2D::_update_pickable() {
if (!is_inside_tree())
return;
- bool pickable = this->pickable && is_inside_tree() && is_visible_in_tree();
+
+ bool is_pickable = pickable && is_visible_in_tree();
if (area)
- Physics2DServer::get_singleton()->area_set_pickable(rid, pickable);
+ Physics2DServer::get_singleton()->area_set_pickable(rid, is_pickable);
else
- Physics2DServer::get_singleton()->body_set_pickable(rid, pickable);
+ Physics2DServer::get_singleton()->body_set_pickable(rid, is_pickable);
}
String CollisionObject2D::get_configuration_warning() const {