DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

0bac8c541c72f5249c72284c0157157bca04e0ad — skye 1 year, 7 months ago 0762ff8
fix(client): despawn supply piles before spawning
1 files changed, 6 insertions(+), 0 deletions(-)

M client/src/plugins/game/supply/mod.rs
M client/src/plugins/game/supply/mod.rs => client/src/plugins/game/supply/mod.rs +6 -0
@@ 34,12 34,18 @@ fn spawn_supply_piles(
    mut commands: Commands,
    game_data: Res<GameData>,
    mut psp_ev_w: EventWriter<PositionSupplyPilesEvent>,
    mut pile_query: Query<Entity, With<visual_card_kind::Supply>>,
) {
    let Some(status) = &game_data.game_status else {
        warn!("game_status was none");
        return;
    };

    // despawn possible existing supply piles
    for entity in pile_query.iter() {
        commands.entity(entity).despawn_recursive();
    }

    for (index, pile) in status.supply_piles.iter().enumerate() {
        commands
            .spawn(VisualCardBundle {