Fix crash in cAudioManager::ServicePoliceRadio

This commit is contained in:
Filip Gawin 2020-04-18 12:20:20 +02:00
parent 2b1570de70
commit 3f32b69a79

View file

@ -1,15 +1,18 @@
#include "common.h" #include "common.h"
#include "DMAudio.h" #include "DMAudio.h"
#include "AudioManager.h" #include "AudioManager.h"
#include "AudioSamples.h" #include "AudioSamples.h"
#include "MusicManager.h" #include "MusicManager.h"
#include "PoliceRadio.h"
#include "PlayerPed.h" #include "PlayerPed.h"
#include "sampman.h" #include "PoliceRadio.h"
#include "Zones.h" #include "Replay.h"
#include "Vehicle.h" #include "Vehicle.h"
#include "World.h" #include "World.h"
#include "Zones.h"
#include "sampman.h"
const int maxVolume = 127; const int maxVolume = 127;
const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples); const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples);
@ -155,7 +158,8 @@ cAudioManager::ServicePoliceRadio()
if(!m_bUserPause) { if(!m_bUserPause) {
bool crimeReport = SetupCrimeReport(); bool crimeReport = SetupCrimeReport();
#ifdef FIX_BUGS // Crash at 0x5fe6ef #ifdef FIX_BUGS // Crash at 0x5fe6ef
if(!FindPlayerPed() || !FindPlayerPed()->m_pWanted) return; if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted)
return;
#endif #endif
wantedLevel = FindPlayerPed()->m_pWanted->m_nWantedLevel; wantedLevel = FindPlayerPed()->m_pWanted->m_nWantedLevel;
if(!crimeReport) { if(!crimeReport) {