Stop network serializing prototypes (#38602)
* Stop network serializing prototypes Send the damn proto ID instead. * Fix sandbox violation
This commit is contained in:
committed by
GitHub
parent
bb7e7c3e5f
commit
73df3b1593
@@ -2,6 +2,7 @@ using Content.Server.Chat.Systems;
|
||||
using Content.Server.Speech.Components;
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Content.Shared.Speech.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Speech.EntitySystems;
|
||||
|
||||
@@ -9,6 +10,7 @@ public sealed class MumbleAccentSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly ChatSystem _chat = default!;
|
||||
[Dependency] private readonly ReplacementAccentSystem _replacement = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -23,10 +25,14 @@ public sealed class MumbleAccentSystem : EntitySystem
|
||||
if (args.Handled || !args.Emote.Category.HasFlag(EmoteCategory.Vocal))
|
||||
return;
|
||||
|
||||
if (TryComp<VocalComponent>(ent.Owner, out var vocalComp))
|
||||
if (TryComp<VocalComponent>(ent.Owner, out var vocalComp) && vocalComp.EmoteSounds is { } sounds)
|
||||
{
|
||||
// play a muffled version of the vocal emote
|
||||
args.Handled = _chat.TryPlayEmoteSound(ent.Owner, vocalComp.EmoteSounds, args.Emote, ent.Comp.EmoteAudioParams);
|
||||
args.Handled = _chat.TryPlayEmoteSound(
|
||||
ent.Owner,
|
||||
_prototype.Index(sounds),
|
||||
args.Emote,
|
||||
ent.Comp.EmoteAudioParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user