Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutable events can change the event target #13

Closed
rj00a opened this issue Feb 12, 2024 · 0 comments · Fixed by #14
Closed

Mutable events can change the event target #13

rj00a opened this issue Feb 12, 2024 · 0 comments · Fixed by #14

Comments

@rj00a
Copy link
Owner

rj00a commented Feb 12, 2024

This test fails:

#[test]
fn change_event_target() {
    let mut world = World::new();

    #[derive(Event)]
    struct E(#[event(target)] EntityId);

    #[derive(Component)]
    struct C;

    world.add_system(|mut r: ReceiverMut<E, &C>| {
        r.event.0 = EntityId::NULL;
    });

    world.add_system(|_: Receiver<E, &C>| {});

    let e = world.spawn();
    world.insert(e, C);

    world.send(E(e));
}
@rj00a rj00a linked a pull request Feb 13, 2024 that will close this issue
@rj00a rj00a closed this as completed Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant