bevy/crates/bevy_ecs/src/system/commands
JaySpruce 67146bdef7
Add missing unsafe to entity_command::insert_by_id and make it more configurable (#18052)
## Objective

`insert_by_id` is unsafe, but I forgot to add that to the
manually-queueable version in `entity_command`.

It also can only insert using `InsertMode::Replace`, when it could
easily be configurable by threading an `InsertMode` parameter to the
final `BundleInserter::insert` call.

## Solution

- Add `unsafe` and safety comment.
- Add `InsertMode` parameter to `entity_command::insert_by_id`,
`EntityWorldMut::insert_by_id_with_caller`, and
`EntityWorldMut::insert_dynamic_bundle`.
- Add `InsertMode` parameter to `entity_command::insert` and remove
`entity_command::insert_if_new`, for consistency with the other
manually-queued insertion commands.
2025-02-27 06:20:32 +00:00
..
command.rs Small Commands error handling cleanup (#17904) 2025-02-23 22:41:43 +00:00
entity_command.rs Add missing unsafe to entity_command::insert_by_id and make it more configurable (#18052) 2025-02-27 06:20:32 +00:00
error_handler.rs Improved Command Errors (#17215) 2025-01-10 04:15:50 +00:00
mod.rs Add missing unsafe to entity_command::insert_by_id and make it more configurable (#18052) 2025-02-27 06:20:32 +00:00
parallel_scope.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00