From 2c231d79da20ea6757180b5726a6c80e72c1e6e5 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Sat, 23 Mar 2024 20:48:45 +0500 Subject: [PATCH] Fix crash when switching sound to stSimulatingLooped state while there's prefill task active (fixes #1640) Addition to 958757e2c8b6737159803ec35f0cfcca3150e075 --- src/xrSound/SoundRender_Emitter_FSM.cpp | 2 +- src/xrSound/SoundRender_Emitter_StartStop.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xrSound/SoundRender_Emitter_FSM.cpp b/src/xrSound/SoundRender_Emitter_FSM.cpp index dfced028ed7..5e2eccd6d01 100644 --- a/src/xrSound/SoundRender_Emitter_FSM.cpp +++ b/src/xrSound/SoundRender_Emitter_FSM.cpp @@ -184,8 +184,8 @@ void CSoundRender_Emitter::update(float fTime, float dt) if (!update_culling(dt)) { // switch to: SIMULATE - m_current_state = stSimulatingLooped; // switch state SoundRender->i_stop(this); + m_current_state = stSimulatingLooped; // switch state } else { diff --git a/src/xrSound/SoundRender_Emitter_StartStop.cpp b/src/xrSound/SoundRender_Emitter_StartStop.cpp index ecb184bdb5e..33854fafb1d 100644 --- a/src/xrSound/SoundRender_Emitter_StartStop.cpp +++ b/src/xrSound/SoundRender_Emitter_StartStop.cpp @@ -86,13 +86,13 @@ void CSoundRender_Emitter::cancel() { case stPlaying: // switch to: SIMULATE - m_current_state = stSimulating; // switch state SoundRender->i_stop(this); + m_current_state = stSimulating; // switch state break; case stPlayingLooped: // switch to: SIMULATE - m_current_state = stSimulatingLooped; // switch state SoundRender->i_stop(this); + m_current_state = stSimulatingLooped; // switch state break; default: FATAL("Non playing ref_sound forced out of render queue"); break; }