Make Trigger::entity()
panic on Entity::PLACEHOLDER
and add Trigger::get_entity()
#14236
Labels
A-ECS
Entities, components, systems, and events
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
D-Modest
A "normal" level of difficulty; suitable for simple features or challenging fixes
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
X-Contentious
There are nontrivial implications that should be thought through
What problem does this solve or what need does it fill?
Trying to perform commands on trigger entity can lead to errors later than expected (command execution instead of call site).
What solution would you like?
While
Entity::PLACEHOLDER
works great for the internals, the users should be presented with the standard two methods:entity()
- get a valid entity or panicget_entity()
- get a valid entity or noneThis requires a breaking change on
entity()
which currently never panics, but can returnEntity::PLACEHOLDER
.What alternative(s) have you considered?
Check for placeholder by oneself.
The text was updated successfully, but these errors were encountered: