Listener fix for speech (#10240)

This commit is contained in:
Flipp Syder
2022-08-11 02:25:29 -07:00
committed by GitHub
parent 29ce4ead84
commit 0f9e31c988
5 changed files with 32 additions and 12 deletions

View File

@@ -45,9 +45,9 @@ namespace Content.Server.Headset
_radioSystem = EntitySystem.Get<RadioSystem>();
}
public bool CanListen(string message, EntityUid source, RadioChannelPrototype prototype)
public bool CanListen(string message, EntityUid source, RadioChannelPrototype? prototype)
{
return Channels.Contains(prototype.ID) && RadioRequested;
return prototype != null && Channels.Contains(prototype.ID) && RadioRequested;
}
public void Receive(string message, RadioChannelPrototype channel, EntityUid source)
@@ -73,8 +73,13 @@ namespace Content.Server.Headset
_netManager.ServerSendMessage(msg, playerChannel);
}
public void Listen(string message, EntityUid speaker, RadioChannelPrototype channel)
public void Listen(string message, EntityUid speaker, RadioChannelPrototype? channel)
{
if (channel == null)
{
return;
}
Broadcast(message, speaker, channel);
}