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