Skip to content

Commit

Permalink
Fix crash when switching sound to stSimulatingLooped state while ther…
Browse files Browse the repository at this point in the history
…e's prefill task active (fixes OpenXRay#1640)

Addition to 958757e
  • Loading branch information
Xottab-DUTY committed Mar 23, 2024
1 parent 3fc4188 commit 2c231d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/xrSound/SoundRender_Emitter_FSM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/xrSound/SoundRender_Emitter_StartStop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2c231d7

Please sign in to comment.