Fix handheld radio not accounting for obstructions

Fixes #4356
This commit is contained in:
Kara Dinyes
2021-07-25 01:07:28 -07:00
parent 9c39570715
commit 9d36b3371f

View File

@@ -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)