bevyengine / bevyengine/bevy

Ambiguity checker is unaware of run conditions (including States)

Open
#1,693 13 comments 2 reactions 0 assignees View on GitHub
A-ECS A-States C-Bug D-Complex S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

[348e2a3d404bc61afe534371b100dc173f6d076f](https://github.com/bevyengine/bevy/commit/348e2a3d404bc61afe534371b100dc173f6d076f)

## Operating system & version

Irrelevant.

## What you did
```rust
use bevy::ecs::schedule::ReportExecutionOrderAmbiguities;
use bevy::prelude::*;

#[derive(Clone, Eq, PartialEq)]
enum AppState {
Menu,
InGame,
}

#[derive(Default)]
struct Data;

fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_state(AppState::Menu)
.init_resource::()
.insert_resource(ReportExecutionOrderAmbiguities)
.add_system_set(SystemSet::on_update(AppState::Menu).with_system(menu.system()))
.add_system_set(SystemSet::on_update(AppState::InGame).with_system(game.system()))
.run();
}

fn menu(mut _data: ResMut) {}
fn game(mut _data: ResMut) {}
```

## What you expected to happen

No ambiguities should be found.

## What actually happened

A system-order ambiguity between `menu_system` and `gameplay_system` was found.

```
* Parallel systems:
-- "&bevy_scratchpad::game" and "&bevy_scratchpad::menu"
conflicts: ["bevy_scratchpad::Data"]
```

## Additional information

First reported [here](https://discord.com/channels/691052431525675048/742569353878437978/822519321283919902).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.