File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -455,15 +455,13 @@ pub fn validate_parent_has_component<C: Component>(
455
455
let Some ( child_of) = entity_ref. get :: < ChildOf > ( ) else {
456
456
return ;
457
457
} ;
458
- if !world
459
- . get_entity ( child_of. parent ( ) )
460
- . is_ok_and ( |e| e. contains :: < C > ( ) )
461
- {
458
+ let parent = child_of. parent ( ) ;
459
+ if !world. get_entity ( parent) . is_ok_and ( |e| e. contains :: < C > ( ) ) {
462
460
// TODO: print name here once Name lives in bevy_ecs
463
461
let name: Option < String > = None ;
464
462
let debug_name = DebugName :: type_name :: < C > ( ) ;
465
463
warn ! (
466
- "warning[B0004]: {}{name} with the {ty_name} component has a parent without {ty_name}.\n \
464
+ "warning[B0004]: {}{name} with the {ty_name} component has a parent ({parent}) without {ty_name}.\n \
467
465
This will cause inconsistent behaviors! See: https://bevy.org/learn/errors/b0004",
468
466
caller. map( |c| format!( "{c}: " ) ) . unwrap_or_default( ) ,
469
467
ty_name = debug_name. shortname( ) ,
You can’t perform that action at this time.
0 commit comments