bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.01k stars 3.43k forks source link

State API should panic when missing `StatePlugin` #14237

Open MiniaczQ opened 1 month ago

MiniaczQ commented 1 month ago

Bevy version

0.14

What you did

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(MinimalPlugins)
        .init_state::<AppState>()
        .run();
}

#[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Hash, States)]
struct AppState;

What went wrong

Crashes inside init_state on an unwrap that assumed a resource would be available from the plugin. The plugin detection should crash instead with information about missing plugin.

rparrett commented 1 month ago

Related: #14151