From cb698cc3b28891c326ae505686f10c8a6917f9b4 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 11 Apr 2024 21:12:56 +0200 Subject: [PATCH] Revert "reset settings on death/restart" This reverts commit 3676fd444c15ed0f3379b3ca28392f6a671ff78e. --- src/actor.rs | 3 +-- src/main.rs | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/actor.rs b/src/actor.rs index 886865d..9e35787 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -423,13 +423,12 @@ fn handle_player_death( mut ew_sfx: EventWriter, mut ew_effect: EventWriter, mut log: ResMut, - mut settings: ResMut, + settings: Res, ) { for death in er_playerdies.read() { if settings.god_mode { return; } - settings.reset(); for entity in &q_noscenes { cmd.entity(entity).despawn(); } diff --git a/src/main.rs b/src/main.rs index c497348..b4b80a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,7 +77,7 @@ fn setup( fn handle_input( keyboard_input: Res>, - settings: Res, + mut settings: ResMut, mut app_exit_events: ResMut>, mut windows: Query<&mut Window, With>, ) { @@ -93,4 +93,7 @@ fn handle_input( } } } + if keyboard_input.just_pressed(settings.key_restart) { + settings.reset(); + } }