Update components to use EnsureWarn (#2676)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
@@ -45,16 +45,10 @@ namespace Content.Server.GameObjects.Components.Access
|
||||
_privilegedIdContainer = ContainerManagerComponent.Ensure<ContainerSlot>($"{Name}-privilegedId", Owner);
|
||||
_targetIdContainer = ContainerManagerComponent.Ensure<ContainerSlot>($"{Name}-targetId", Owner);
|
||||
|
||||
if (!Owner.EnsureComponent(out AccessReader _))
|
||||
{
|
||||
Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} didn't have a {nameof(AccessReader)}");
|
||||
}
|
||||
Owner.EnsureComponentWarn<AccessReader>();
|
||||
Owner.EnsureComponentWarn<ServerUserInterfaceComponent>();
|
||||
|
||||
if (UserInterface == null)
|
||||
{
|
||||
Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} doesn't have a {nameof(ServerUserInterfaceComponent)}");
|
||||
}
|
||||
else
|
||||
if (UserInterface != null)
|
||||
{
|
||||
UserInterface.OnReceiveMessage += OnUiReceiveMessage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user