Make more uids nullable (#5794)

This commit is contained in:
Leon Friedrich
2021-12-26 15:32:45 +13:00
committed by GitHub
parent 83114de0e4
commit afc3ae6335
42 changed files with 161 additions and 204 deletions

View File

@@ -40,18 +40,12 @@ namespace Content.Server.Stunnable
var source = args.Source;
var target = args.Target;
if (source != null)
{
var knock = EntityManager.GetComponent<KnockedDownComponent>(uid);
SoundSystem.Play(Filter.Pvs(source), knock.StunAttemptSound.GetSound(), source, AudioHelpers.WithVariation(0.025f));
var knock = EntityManager.GetComponent<KnockedDownComponent>(uid);
SoundSystem.Play(Filter.Pvs(source), knock.StunAttemptSound.GetSound(), source, AudioHelpers.WithVariation(0.025f));
if (target != null)
{
// TODO: Use PopupSystem
source.PopupMessageOtherClients(Loc.GetString("stunned-component-disarm-success-others", ("source", Name: EntityManager.GetComponent<MetaDataComponent>(source).EntityName), ("target", Name: EntityManager.GetComponent<MetaDataComponent>(target).EntityName)));
source.PopupMessageCursor(Loc.GetString("stunned-component-disarm-success", ("target", Name: EntityManager.GetComponent<MetaDataComponent>(target).EntityName)));
}
}
// TODO: Use PopupSystem
source.PopupMessageOtherClients(Loc.GetString("stunned-component-disarm-success-others", ("source", Name(source)), ("target", Name(target))));
source.PopupMessageCursor(Loc.GetString("stunned-component-disarm-success", ("target", Name(target))));
_adminLogSystem.Add(LogType.DisarmedKnockdown, LogImpact.Medium, $"{ToPrettyString(args.Source):user} knocked down {ToPrettyString(args.Target):target}");