diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index c431a1a32..3d93e6433 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -5084,22 +5084,8 @@ nullquote: case CON_IFNOSOUNDS: { - int32_t j = MAXSOUNDS-1; - for (; j>=0; j--) - { - int32_t k = 0; - - for (; k is playing any sound. +int32_t A_CheckAnySoundPlaying(int32_t i) +{ + int32_t j; + + for (j=g_maxSoundPos; j>=0; j--) + { + int32_t k; + + for (k=0; k g_maxSoundPos || num < 0) return 0; diff --git a/polymer/eduke32/source/sounds.h b/polymer/eduke32/source/sounds.h index 1dd8d1e1b..84235919b 100644 --- a/polymer/eduke32/source/sounds.h +++ b/polymer/eduke32/source/sounds.h @@ -75,6 +75,7 @@ extern int32_t g_numEnvSoundsPlaying,g_maxSoundPos; int32_t A_CheckSoundPlaying(int32_t i,int32_t num); int32_t A_PlaySound(uint32_t num,int32_t i); void S_Callback(uint32_t num); +int32_t A_CheckAnySoundPlaying(int32_t i); int32_t S_CheckSoundPlaying(int32_t i,int32_t num); void S_Cleanup(void); void S_ClearSoundLocks(void);