summaryrefslogtreecommitdiffstats
path: root/src/audio/PoliceRadio.cpp
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2020-04-12 02:39:27 +0200
committerFilip Gawin <filip.gawin@zoho.com>2020-04-12 02:50:52 +0200
commit7d137d8f2d3effa96593cae34e7259e0ab025e4d (patch)
treece20ef7e4c6bdad4c9677962bbf5e603e3b89f50 /src/audio/PoliceRadio.cpp
parentMerge pull request #405 from erorcun/erorcun (diff)
downloadre3-7d137d8f2d3effa96593cae34e7259e0ab025e4d.tar
re3-7d137d8f2d3effa96593cae34e7259e0ab025e4d.tar.gz
re3-7d137d8f2d3effa96593cae34e7259e0ab025e4d.tar.bz2
re3-7d137d8f2d3effa96593cae34e7259e0ab025e4d.tar.lz
re3-7d137d8f2d3effa96593cae34e7259e0ab025e4d.tar.xz
re3-7d137d8f2d3effa96593cae34e7259e0ab025e4d.tar.zst
re3-7d137d8f2d3effa96593cae34e7259e0ab025e4d.zip
Diffstat (limited to 'src/audio/PoliceRadio.cpp')
-rw-r--r--src/audio/PoliceRadio.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/audio/PoliceRadio.cpp b/src/audio/PoliceRadio.cpp
index 3ba16ef3..255d7026 100644
--- a/src/audio/PoliceRadio.cpp
+++ b/src/audio/PoliceRadio.cpp
@@ -125,7 +125,7 @@ void
cAudioManager::DoPoliceRadioCrackle()
{
m_sQueueSample.m_nEntityIndex = m_nPoliceChannelEntity;
- m_sQueueSample.m_counter = 0;
+ m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_nSampleIndex = SFX_POLICE_RADIO_CRACKLE;
m_sQueueSample.m_bBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_bIs2D = true;
@@ -136,7 +136,7 @@ cAudioManager::DoPoliceRadioCrackle()
m_sQueueSample.m_bEmittingVolume = m_sQueueSample.m_bVolume;
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(SFX_POLICE_RADIO_CRACKLE);
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(SFX_POLICE_RADIO_CRACKLE);
- m_sQueueSample.m_bReleasingSoundFlag = 0;
+ m_sQueueSample.m_bReleasingSoundFlag = false;
m_sQueueSample.m_bReverbFlag = false;
m_sQueueSample.m_bOffset = 63;
m_sQueueSample.m_nReleasingVolumeDivider = 3;
@@ -147,17 +147,20 @@ cAudioManager::DoPoliceRadioCrackle()
void
cAudioManager::ServicePoliceRadio()
{
- int32 wantedLevel = 0; // bug?;
+ int32 wantedLevel = 0; // uninitialized variable
static uint32 nLastSeen = 300;
- if (!m_bIsInitialised) return;
+ if(!m_bIsInitialised) return;
- if (!m_bUserPause) {
+ if(!m_bUserPause) {
bool crimeReport = SetupCrimeReport();
+#ifdef FIX_BUGS // Crash at 0x5fe6ef
+ if(!FindPlayerPed() || !FindPlayerPed()->m_pWanted) return;
+#endif
wantedLevel = FindPlayerPed()->m_pWanted->m_nWantedLevel;
- if (!crimeReport) {
- if (wantedLevel) {
- if (nLastSeen) {
+ if(!crimeReport) {
+ if(wantedLevel) {
+ if(nLastSeen) {
--nLastSeen;
} else {
nLastSeen = m_anRandomTable[1] % 1000 + 2000;