mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
Add entity id to hierarchy propagation error message (#12733)
# Objective - Fixes https://github.com/bevyengine/bevy/issues/12731 ## Solution - Use the `Name` component if present, else default to `Entity 0v1` instead of `An entity`
This commit is contained in:
parent
a0f492b2dd
commit
b7ab1466c7
1 changed files with 1 additions and 1 deletions
|
@ -68,7 +68,7 @@ pub fn check_hierarchy_component_has_valid_parent<T: Component>(
|
||||||
"warning[B0004]: {name} with the {ty_name} component has a parent without {ty_name}.\n\
|
"warning[B0004]: {name} with the {ty_name} component has a parent without {ty_name}.\n\
|
||||||
This will cause inconsistent behaviors! See: https://bevyengine.org/learn/errors/#b0004",
|
This will cause inconsistent behaviors! See: https://bevyengine.org/learn/errors/#b0004",
|
||||||
ty_name = get_short_name(std::any::type_name::<T>()),
|
ty_name = get_short_name(std::any::type_name::<T>()),
|
||||||
name = name.map_or("An entity".to_owned(), |s| format!("The {s} entity")),
|
name = name.map_or_else(|| format!("Entity {}", entity), |s| format!("The {s} entity")),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue