Fix cAudioManager::AddReleasingSounds

This commit is contained in:
Sergeanur 2019-10-27 15:15:39 +02:00
parent f090708a90
commit 80b85a417c

View File

@ -415,11 +415,12 @@ cAudioManager::AddReleasingSounds()
{ {
bool toProcess[44]; bool toProcess[44];
for(int32 i = 0; i < m_bSampleRequestQueuesStatus[m_bActiveSampleQueue]; i++) { int8 queue = m_bActiveSampleQueue == 0;
tActiveSample &sample =
m_asSamples[!m_bActiveSampleQueue][m_abSampleQueueIndexTable[!m_bActiveSampleQueue][i]]; for(int32 i = 0; i < m_bSampleRequestQueuesStatus[queue]; i++) {
if(!m_asSamples[!m_bActiveSampleQueue][m_abSampleQueueIndexTable[!m_bActiveSampleQueue][i]] tActiveSample &sample = m_asSamples[queue][m_abSampleQueueIndexTable[queue][i]];
.m_bLoopEnded) { if (sample.m_bLoopEnded) continue;
toProcess[i] = false; toProcess[i] = false;
for(int32 j = 0; j < m_bSampleRequestQueuesStatus[m_bActiveSampleQueue]; j++) { for(int32 j = 0; j < m_bSampleRequestQueuesStatus[m_bActiveSampleQueue]; j++) {
if(sample.m_nEntityIndex == if(sample.m_nEntityIndex ==
@ -453,11 +454,10 @@ cAudioManager::AddReleasingSounds()
} }
sample.field_56 = 0; sample.field_56 = 0;
} }
memcpy(&m_sQueueSample, &sample, 92); memcpy(&m_sQueueSample, &sample, sizeof(sample));
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
} }
}
} }
void void