mirror of
https://github.com/godotengine/godot.git
synced 2024-11-11 06:33:10 +00:00
Fix RayCast{2,3}D.clear_exceptions clears parent
This commit is contained in:
parent
0154ce2c8d
commit
bbcd9c5b97
@ -279,6 +279,13 @@ void RayCast2D::remove_exception(const CollisionObject2D *p_node) {
|
||||
|
||||
void RayCast2D::clear_exceptions() {
|
||||
exclude.clear();
|
||||
|
||||
if (exclude_parent_body && is_inside_tree()) {
|
||||
CollisionObject2D *parent = Object::cast_to<CollisionObject2D>(get_parent());
|
||||
if (parent) {
|
||||
exclude.insert(parent->get_rid());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RayCast2D::set_collide_with_areas(bool p_enabled) {
|
||||
|
@ -259,6 +259,13 @@ void RayCast3D::remove_exception(const CollisionObject3D *p_node) {
|
||||
|
||||
void RayCast3D::clear_exceptions() {
|
||||
exclude.clear();
|
||||
|
||||
if (exclude_parent_body && is_inside_tree()) {
|
||||
CollisionObject3D *parent = Object::cast_to<CollisionObject3D>(get_parent());
|
||||
if (parent) {
|
||||
exclude.insert(parent->get_rid());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RayCast3D::set_collide_with_areas(bool p_enabled) {
|
||||
|
Loading…
Reference in New Issue
Block a user