From 371e5348a604bab5aadc4e445d1979e7b34ba6f7 Mon Sep 17 00:00:00 2001 From: in0finite Date: Tue, 4 Jan 2022 19:00:08 +0100 Subject: [PATCH] ... --- Assets/Scripts/Behaviours/Ped/Ped_Networking.cs | 15 +++++++++------ .../Scripts/Behaviours/Ped/States/PanicState.cs | 8 -------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Assets/Scripts/Behaviours/Ped/Ped_Networking.cs b/Assets/Scripts/Behaviours/Ped/Ped_Networking.cs index aa2fbb65..e02f2340 100644 --- a/Assets/Scripts/Behaviours/Ped/Ped_Networking.cs +++ b/Assets/Scripts/Behaviours/Ped/Ped_Networking.cs @@ -263,14 +263,17 @@ namespace SanAndreasUnity.Behaviours if (NetStatus.IsServer) return; - if (string.IsNullOrEmpty(newSoundId.fileName)) + F.RunExceptionSafe(() => { - if (_mouthAudioSource != null) - _mouthAudioSource.Stop(); - return; - } + if (string.IsNullOrEmpty(newSoundId.fileName)) + { + if (_mouthAudioSource != null) + _mouthAudioSource.Stop(); + return; + } - this.PlaySoundFromPedMouth(newSoundId); + this.PlaySoundFromPedMouth(newSoundId); + }); } } diff --git a/Assets/Scripts/Behaviours/Ped/States/PanicState.cs b/Assets/Scripts/Behaviours/Ped/States/PanicState.cs index 69a419ea..cb5ed845 100644 --- a/Assets/Scripts/Behaviours/Ped/States/PanicState.cs +++ b/Assets/Scripts/Behaviours/Ped/States/PanicState.cs @@ -24,14 +24,6 @@ namespace SanAndreasUnity.Behaviours.Peds.States private float _timeToEmitSound; - /*public override void OnBecameActive() - { - base.OnBecameActive(); - - if (m_isServer) - this.TryEmitSound(); - }*/ - public override void UpdateState() { this.TryEmitSound();