reset settings on death/restart
This commit is contained in:
parent
d0df5c5dbd
commit
3676fd444c
|
@ -423,12 +423,13 @@ fn handle_player_death(
|
|||
mut ew_sfx: EventWriter<audio::PlaySfxEvent>,
|
||||
mut ew_effect: EventWriter<effects::SpawnEffectEvent>,
|
||||
mut log: ResMut<hud::Log>,
|
||||
settings: Res<settings::Settings>,
|
||||
mut settings: ResMut<settings::Settings>,
|
||||
) {
|
||||
for death in er_playerdies.read() {
|
||||
if settings.god_mode {
|
||||
return;
|
||||
}
|
||||
settings.reset();
|
||||
for entity in &q_noscenes {
|
||||
cmd.entity(entity).despawn();
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ fn setup(
|
|||
|
||||
fn handle_input(
|
||||
keyboard_input: Res<ButtonInput<KeyCode>>,
|
||||
mut settings: ResMut<settings::Settings>,
|
||||
settings: Res<settings::Settings>,
|
||||
mut app_exit_events: ResMut<Events<bevy::app::AppExit>>,
|
||||
mut windows: Query<&mut Window, With<PrimaryWindow>>,
|
||||
) {
|
||||
|
@ -93,7 +93,4 @@ fn handle_input(
|
|||
}
|
||||
}
|
||||
}
|
||||
if keyboard_input.just_pressed(settings.key_restart) {
|
||||
settings.reset();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue