No echo from handheld radio (#27046)
I found the echo from my own radio very annoying.
This commit is contained in:
@@ -201,6 +201,9 @@ public sealed class RadioDeviceSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnReceiveRadio(EntityUid uid, RadioSpeakerComponent component, ref RadioReceiveEvent args)
|
private void OnReceiveRadio(EntityUid uid, RadioSpeakerComponent component, ref RadioReceiveEvent args)
|
||||||
{
|
{
|
||||||
|
if (uid == args.RadioSource)
|
||||||
|
return;
|
||||||
|
|
||||||
var nameEv = new TransformSpeakerNameEvent(args.MessageSource, Name(args.MessageSource));
|
var nameEv = new TransformSpeakerNameEvent(args.MessageSource, Name(args.MessageSource));
|
||||||
RaiseLocalEvent(args.MessageSource, nameEv);
|
RaiseLocalEvent(args.MessageSource, nameEv);
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public sealed class RadioSystem : EntitySystem
|
|||||||
NetEntity.Invalid,
|
NetEntity.Invalid,
|
||||||
null);
|
null);
|
||||||
var chatMsg = new MsgChatMessage { Message = chat };
|
var chatMsg = new MsgChatMessage { Message = chat };
|
||||||
var ev = new RadioReceiveEvent(message, messageSource, channel, chatMsg);
|
var ev = new RadioReceiveEvent(message, messageSource, channel, radioSource, chatMsg);
|
||||||
|
|
||||||
var sendAttemptEv = new RadioSendAttemptEvent(channel, radioSource);
|
var sendAttemptEv = new RadioSendAttemptEvent(channel, radioSource);
|
||||||
RaiseLocalEvent(ref sendAttemptEv);
|
RaiseLocalEvent(ref sendAttemptEv);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using Content.Shared.Radio;
|
|||||||
namespace Content.Server.Radio;
|
namespace Content.Server.Radio;
|
||||||
|
|
||||||
[ByRefEvent]
|
[ByRefEvent]
|
||||||
public readonly record struct RadioReceiveEvent(string Message, EntityUid MessageSource, RadioChannelPrototype Channel, MsgChatMessage ChatMsg);
|
public readonly record struct RadioReceiveEvent(string Message, EntityUid MessageSource, RadioChannelPrototype Channel, EntityUid RadioSource, MsgChatMessage ChatMsg);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Use this event to cancel sending message per receiver
|
/// Use this event to cancel sending message per receiver
|
||||||
|
|||||||
Reference in New Issue
Block a user