From 7e056f1b3761403add50adb2e724b979899d3836 Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Sun, 18 Sep 2022 23:18:29 +0200 Subject: Fix physics events being interpreted twice when in canvas layer --- doc/classes/PhysicsPointQueryParameters2D.xml | 1 + servers/physics_2d/godot_space_2d.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/classes/PhysicsPointQueryParameters2D.xml b/doc/classes/PhysicsPointQueryParameters2D.xml index 76dc816dab..15102830f8 100644 --- a/doc/classes/PhysicsPointQueryParameters2D.xml +++ b/doc/classes/PhysicsPointQueryParameters2D.xml @@ -11,6 +11,7 @@ If different from [code]0[/code], restricts the query to a specific canvas layer specified by its instance ID. See [method Object.get_instance_id]. + If [code]0[/code], restricts the query to the Viewport's default canvas layer. If [code]true[/code], the query will take [Area2D]s into account. diff --git a/servers/physics_2d/godot_space_2d.cpp b/servers/physics_2d/godot_space_2d.cpp index 89afb0e2a0..0a624b3f30 100644 --- a/servers/physics_2d/godot_space_2d.cpp +++ b/servers/physics_2d/godot_space_2d.cpp @@ -83,7 +83,7 @@ int GodotPhysicsDirectSpaceState2D::intersect_point(const PointParameters &p_par continue; } - if (p_parameters.canvas_instance_id.is_valid() && col_obj->get_canvas_instance_id() != p_parameters.canvas_instance_id) { + if (col_obj->get_canvas_instance_id() != p_parameters.canvas_instance_id) { continue; } -- cgit v1.2.3