From 9d36b3371f81985611e348678abd30b7e46d0ca0 Mon Sep 17 00:00:00 2001 From: Kara Dinyes Date: Sun, 25 Jul 2021 01:07:28 -0700 Subject: [PATCH] Fix handheld radio not accounting for obstructions Fixes #4356 --- Content.Server/Radio/Components/HandheldRadioComponent.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server/Radio/Components/HandheldRadioComponent.cs b/Content.Server/Radio/Components/HandheldRadioComponent.cs index d3ae7c3167..eabd047e9b 100644 --- a/Content.Server/Radio/Components/HandheldRadioComponent.cs +++ b/Content.Server/Radio/Components/HandheldRadioComponent.cs @@ -3,6 +3,7 @@ using Content.Server.Chat.Managers; using Content.Server.Radio.EntitySystems; using Content.Shared.Examine; using Content.Shared.Interaction; +using Content.Shared.Interaction.Helpers; using Content.Shared.Notification; using Content.Shared.Notification.Managers; using Robust.Shared.GameObjects; @@ -80,8 +81,7 @@ namespace Content.Server.Radio.Components public bool CanListen(string message, IEntity source) { return RadioOn && - Owner.Transform.Coordinates.TryDistance(Owner.EntityManager, source.Transform.Coordinates, out var distance) && - distance <= ListenRange; + Owner.InRangeUnobstructed(source.Transform.Coordinates, range: ListenRange); } public void Receive(string message, int channel, IEntity speaker)