Some manual GetComponentOrNull inlines
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Shared.Pulling;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.Alert.Click
|
||||
@@ -17,11 +18,10 @@ namespace Content.Server.Alert.Click
|
||||
public void AlertClicked(ClickAlertEventArgs args)
|
||||
{
|
||||
var ps = EntitySystem.Get<SharedPullingSystem>();
|
||||
var playerTargetPullable = ps.GetPulled(args.Player)?
|
||||
.GetComponentOrNull<SharedPullableComponent>();
|
||||
if (playerTargetPullable != null)
|
||||
var playerTarget = ps.GetPulled(args.Player);
|
||||
if (playerTarget != null && IoCManager.Resolve<IEntityManager>().TryGetComponent(playerTarget.Uid, out SharedPullableComponent playerPullable))
|
||||
{
|
||||
ps.TryStopPull(playerTargetPullable);
|
||||
ps.TryStopPull(playerPullable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user