don't play suffocation sound in god mode

This commit is contained in:
yuni 2024-10-03 06:03:55 +02:00
parent 108efd0e55
commit f583200b13

View file

@ -267,6 +267,7 @@ pub fn play_zoom_sfx(
} }
pub fn play_gasp_sfx( pub fn play_gasp_sfx(
settings: Res<Settings>,
player: Query<&actor::Suit, With<actor::Player>>, player: Query<&actor::Suit, With<actor::Player>>,
mut ew_sfx: EventWriter<PlaySfxEvent>, mut ew_sfx: EventWriter<PlaySfxEvent>,
q_audiosinks: Query<(&audio::Sfx, &AudioSink)>, q_audiosinks: Query<(&audio::Sfx, &AudioSink)>,
@ -276,7 +277,7 @@ pub fn play_gasp_sfx(
if *sfxtype != Sfx::Gasp { if *sfxtype != Sfx::Gasp {
continue; continue;
} }
if suit.oxygen <= 0.0 { if suit.oxygen <= 0.0 && !settings.god_mode {
sink.set_volume(0.6); sink.set_volume(0.6);
sink.play(); sink.play();
} else { } else {