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

Fix #134 . Missing current_item reset during reset_changed_item_counts. #216

Closed
wants to merge 1 commit into from
Closed

Conversation

BorisBoutillier
Copy link
Contributor

Reset of the buffer was missing an attribute reset.

Locally unit tested with addition of a despawn/spawn system in 2d/sprite.rs
Tested against my local code using bevy that was failing before.

@karroffel karroffel added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Aug 17, 2020
Copy link
Contributor

@karroffel karroffel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you very much for the PR! (I can't merge but I'm sure cart will take a look later)

@Cupnfish
Copy link
Contributor

Reset of the buffer was missing an attribute reset.

Locally unit tested with addition of a despawn/spawn system in 2d/sprite.rs
Tested against my local code using bevy that was failing before.

fn spawn_cube(
    mut commands: Commands,
    mouse_input: Res<Input<MouseButton>>,
    mut meshes: ResMut<Assets<Mesh>>,
    mut materials: ResMut<Assets<StandardMaterial>>,
){
    if mouse_input.pressed(MouseButton::Left) {
        commands.spawn(PbrComponents {
            mesh:meshes.add(Mesh::from(shape::Cube {size:0.5})),
            material: materials.add(Color::rgba(0.5, 0.5, 0.5, 0.8).into()),
            translation: Translation::new(0.0, 2.0, 0.0),
            ..Default::default()
        })
        .with(Flyable::default())
        .with(CouldDespawn);
    }
}
fn despawn_cube(
    mut commands: Commands,
    mouse_input:Res<Input<MouseButton>>,
    mut cubes:Query<With<CouldDespawn,Entity>>,
) {
    for cube in &mut cubes.iter() {
        if mouse_input.pressed(MouseButton::Right) {
            commands.despawn(cube);
        }
    }
}

I tested my code and Despawn didn't really crash, but Spawn didn't add Cube properly

@BorisBoutillier
Copy link
Contributor Author

@YRainbbbb I have added your spawn and despawn system to the 3d/3d_scne.rs example and the spawn and despawn continously work properly after with fix.

@BorisBoutillier
Copy link
Contributor Author

BorisBoutillier commented Aug 18, 2020

#135 is similar as #134
@katis code no more crash during despawn but has some missing rendering afterwards, perhaps similarly as @YRainbbbb reported.
The fix is not correct . I'll work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants