File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
source/game_sa/Audio/entities Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -624,11 +624,12 @@ eSoundID CAECollisionAudioEntity::ChooseCollisionSoundID(eSurfaceType surface) {
624624 if (l->MinSoundID == l->MaxSoundID ) {
625625 return l->MinSoundID ;
626626 }
627- while ( true ) {
627+ for ( auto retry = 0 ; retry < 100 ; retry++ ) { // NOTSA: Handle very unlikely infinite loop
628628 const auto soundID = CAEAudioUtility::GetRandomNumberInRange (l->MinSoundID , l->MaxSoundID );
629629 if (soundID != m_CollisionSoundIDHistory[surface]) {
630630 return soundID;
631631 }
632632 }
633- NOTSA_UNREACHABLE ();
633+ NOTSA_LOG_WARN (" Failed to generate collision sound ID not in history!" ); // NOTSA
634+ return l->MinSoundID ; // NOTSA
634635}
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ class NOTSA_EXPORT_VTABLE CAECollisionAudioEntity : public CAEAudioEntity {
7676 void Service ();
7777
7878 // notsa
79- bool CanAddNewSound () const { return m_CollisionSoundList.size () != m_NumActiveCollisionSounds ; }
79+ bool CanAddNewSound () const { return m_NumActiveCollisionSounds <= m_CollisionSoundList.size (); }
8080
8181protected:
8282 eSoundID ChooseCollisionSoundID (eSurfaceType surface);
You can’t perform that action at this time.
0 commit comments