Add-d-ds s-s-stut-ttering t-to the g-gam-me (#4901)

This commit is contained in:
Vera Aguilera Puerto
2021-10-17 01:23:31 +02:00
committed by GitHub
parent 50802b123f
commit 3001ea38cc
9 changed files with 132 additions and 4 deletions

View File

@@ -0,0 +1,15 @@
using System;
using Content.Shared.Alert;
using Content.Shared.StatusEffect;
using Robust.Shared.GameObjects;
namespace Content.Shared.Speech.EntitySystems
{
public abstract class SharedStutteringSystem : EntitySystem
{
// For code in shared... I imagine we ain't getting accent prediction anytime soon so let's not bother.
public virtual void DoStutter(EntityUid uid, TimeSpan time, StatusEffectsComponent? status = null, SharedAlertsComponent? alerts = null)
{
}
}
}

View File

@@ -213,9 +213,11 @@ namespace Content.Shared.StatusEffect
Resolve(uid, ref alerts, false);
var state = status.ActiveEffects[key];
if (state.RelevantComponent != null)
// There are cases where a status effect component might be server-only, so TryGetRegistration...
if (state.RelevantComponent != null && _componentFactory.TryGetRegistration(state.RelevantComponent, out var registration))
{
var type = _componentFactory.GetRegistration(state.RelevantComponent).Type;
var type = registration.Type;
// Make sure the component is actually there first.
// Maybe a badmin badminned the component away,