diff --git a/src/Hypnonema.Client/Players/VideoPlayer2D.cs b/src/Hypnonema.Client/Players/VideoPlayer2D.cs index 3c9952c..44cc132 100644 --- a/src/Hypnonema.Client/Players/VideoPlayer2D.cs +++ b/src/Hypnonema.Client/Players/VideoPlayer2D.cs @@ -55,9 +55,15 @@ public async Task OnTick() this.Draw(); var entity = GetClosestObjectOfType(this.SoundMaxDistance, (uint)this.RenderTarget.Hash); + if (entity == null) + { + this.Browser.SendVolume(0f); + return; + } + var distance = World.GetDistance(Game.PlayerPed.Position, entity.Position); - if (distance >= this.SoundMaxDistance || entity == null) + if (distance >= this.SoundMaxDistance) { this.Browser.SendVolume(0f); }