bevy/crates/bevy_ecs/src
Rob Grindeland 0335f34561
Add missing return in default Relationship::on_insert impl (#17675)
# Objective

There was a bug in the default `Relationship::on_insert` implementation
that caused it to not properly handle entities targeting themselves in
relationships. The relationship component was properly removed, but it
would go on to add itself to its own target component.

## Solution

Added a missing `return` and a couple of tests
(`self_relationship_fails` failed on its second assert prior to this
PR).

## Testing

See above.
2025-02-05 21:26:16 +00:00
..
entity implement UniqueEntitySlice (#17589) 2025-02-05 18:10:56 +00:00
event Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
identifier bevy_ecs: Apply #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (#17335) 2025-01-14 21:37:41 +00:00
observer Isolate component registration (#17671) 2025-02-05 19:59:30 +00:00
query Isolate component registration (#17671) 2025-02-05 19:59:30 +00:00
reflect Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
relationship Add missing return in default Relationship::on_insert impl (#17675) 2025-02-05 21:26:16 +00:00
schedule Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
storage Isolate component registration (#17671) 2025-02-05 19:59:30 +00:00
system Introduce methods on QueryState to obtain a Query (#15858) 2025-02-05 18:33:15 +00:00
world Isolate component registration (#17671) 2025-02-05 19:59:30 +00:00
archetype.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
batching.rs Fix *most* clippy lints (#15906) 2024-10-14 20:52:35 +00:00
bundle.rs Isolate component registration (#17671) 2025-02-05 19:59:30 +00:00
change_detection.rs Added try_map_unchanged. (#17653) 2025-02-03 22:03:39 +00:00
component.rs Isolate component registration (#17671) 2025-02-05 19:59:30 +00:00
entity_disabling.rs Add simple Disabled marker (#17514) 2025-02-02 21:42:25 +00:00
hierarchy.rs Refactored ComponentHook Parameters into HookContext (#17503) 2025-01-23 02:45:24 +00:00
intern.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
label.rs Add compile-time dyn compatible checks for DynEq, DynHash (#17254) 2025-01-09 07:30:54 +00:00
lib.rs Isolate component registration (#17671) 2025-02-05 19:59:30 +00:00
name.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
removal_detection.rs Replace map + unwrap_or(true) with is_none_or (#17070) 2024-12-31 20:17:03 +00:00
resource.rs Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
result.rs Add no_std support to bevy_ecs (#16758) 2024-12-17 21:40:36 +00:00
traversal.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00