diff options
author | Sergeanur <s.anureev@yandex.ua> | 2019-10-17 16:10:27 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2019-10-17 16:10:27 +0300 |
commit | 17ffb9942069b06ce33a63dc9cb6028cf0beb04b (patch) | |
tree | 5d2c8cfb4aceb3718ba88578c57a43f6baf136cb | |
parent | 3ba57c5f6a9f7fb678181a39010dcec6a05b5121 (diff) |
Fixed train sounds not working
-rw-r--r-- | src/audio/AudioManager.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index d32d4207..b82c650c 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -7376,12 +7376,12 @@ bool cAudioManager::ProcessTrainNoise(cVehicleParams *params) { CTrain *train; - int32 emittingVol; + uint8 emittingVol; float speedMultipler; if(params->m_fDistance >= 90000.f) return 0; - if(params->m_fVelocityChange <= 0.0f) { + if(params->m_fVelocityChange > 0.0f) { CalculateDistance((bool *)params, params->m_fDistance); train = (CTrain *)params->m_pVehicle; speedMultipler = min(1.0f, train->m_fSpeed * 250.f / 51.f); @@ -7427,11 +7427,8 @@ cAudioManager::ProcessTrainNoise(cVehicleParams *params) 100 * m_sQueueSample.m_nEntityIndex % 987; m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_bEmittingVolume = emittingVol; - m_sQueueSample.m_nLoopStart = - SampleManager.GetSampleLoopStartOffset( - m_sQueueSample.m_nSampleIndex); - m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset( - m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(m_sQueueSample.m_nSampleIndex); + m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.field_48 = 6.0f; m_sQueueSample.m_fSoundIntensity = 70.0f; m_sQueueSample.field_56 = 0; |