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

is_plugin_added is always true for Self #13815

Closed
kristoff3r opened this issue Jun 11, 2024 · 0 comments · Fixed by #13817
Closed

is_plugin_added is always true for Self #13815

kristoff3r opened this issue Jun 11, 2024 · 0 comments · Fixed by #13817
Labels
A-App Bevy apps and plugins C-Bug An unexpected or incorrect behavior S-Needs-Design This issue requires design work to think about how it would best be accomplished
Milestone

Comments

@kristoff3r
Copy link
Contributor

Bevy version

0.14.0-rc.2

What you did

The following program panics in Bevy 0.14.0-rc.2, but runs successfully in 0.13.2

use bevy::prelude::*;

fn main() {
    let app = App::new().add_plugins(Foo);
}

pub struct Foo;

impl Plugin for Foo {
    fn build(&self, app: &mut App) {
        if app.is_plugin_added::<Self>() {
            panic!()
        }
    }
}

What went wrong

Either the previous behavior should be restored, or we should document it in the migration guide.

Additional information

@kristoff3r kristoff3r added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 11, 2024
@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Jun 11, 2024
@alice-i-cecile alice-i-cecile added A-App Bevy apps and plugins S-Needs-Design This issue requires design work to think about how it would best be accomplished and removed S-Needs-Triage This issue needs to be labelled labels Jun 11, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 14, 2024
# Objective

Fixes #13815 

## Solution

Move insertion of the plugin name to after build is called.

## Testing

I added a regression test

---------

Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: François Mockers <[email protected]>
Co-authored-by: François Mockers <[email protected]>
mockersf added a commit that referenced this issue Jun 14, 2024
# Objective

Fixes #13815 

## Solution

Move insertion of the plugin name to after build is called.

## Testing

I added a regression test

---------

Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: François Mockers <[email protected]>
Co-authored-by: François Mockers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-App Bevy apps and plugins C-Bug An unexpected or incorrect behavior S-Needs-Design This issue requires design work to think about how it would best be accomplished
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants