Inline TryGetComponent completely

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:05:23 +01:00
parent f3edecf994
commit 2ff4ec65d5
34 changed files with 98 additions and 84 deletions

View File

@@ -1,6 +1,8 @@
using Content.Server.Cuffs.Components;
using Content.Shared.Alert;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Alert.Click
@@ -14,7 +16,7 @@ namespace Content.Server.Alert.Click
{
public void AlertClicked(ClickAlertEventArgs args)
{
if (args.Player.TryGetComponent(out CuffableComponent? cuffableComponent))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(args.Player.Uid, out CuffableComponent? cuffableComponent))
{
cuffableComponent.TryUncuff(args.Player);
}