Some manual GetComponentOrNull inlines

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 15:09:45 +01:00
parent a5b57c8e10
commit 61be228ad0
10 changed files with 48 additions and 25 deletions

View File

@@ -180,7 +180,7 @@ namespace Content.Server.Administration
// Make ghost role verb
if (_groupController.CanCommand(player, "makeghostrole") &&
!(args.Target.GetComponentOrNull<MindComponent>()?.HasMind ?? false))
!(IoCManager.Resolve<IEntityManager>().GetComponentOrNull<MindComponent>(args.TargetUid)?.HasMind ?? false))
{
Verb verb = new();
verb.Text = Loc.GetString("make-ghost-role-verb-get-data-text");
@@ -194,7 +194,7 @@ namespace Content.Server.Administration
// Configuration verb. Is this even used for anything!?
if (_groupController.CanAdminMenu(player) &&
IoCManager.Resolve<IEntityManager>().TryGetComponent<ConfigurationComponent?>(args.Target.Uid, out var config))
IoCManager.Resolve<IEntityManager>().TryGetComponent<ConfigurationComponent?>(args.TargetUid, out var config))
{
Verb verb = new();
verb.Text = Loc.GetString("configure-verb-get-data-text");