Update components to use EnsureWarn (#2676)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
@@ -36,7 +36,7 @@ namespace Content.Server.GameObjects.Components.Power.PowerNetComponents
|
||||
base.Initialize();
|
||||
|
||||
Owner.EnsureComponent<BatteryComponent>();
|
||||
Owner.EnsureComponent<AppearanceComponent>();
|
||||
Owner.EnsureComponentWarn<AppearanceComponent>();
|
||||
}
|
||||
|
||||
public void OnUpdate()
|
||||
|
||||
@@ -4,7 +4,6 @@ using Content.Shared.GameObjects.EntitySystems;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Interfaces.Timing;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
@@ -73,10 +72,7 @@ namespace Content.Server.GameObjects.Components.Power.PowerNetComponents
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
if (!Owner.EnsureComponent(out PowerSupplierComponent _))
|
||||
{
|
||||
Logger.Warning($"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(PowerSupplierComponent)}");
|
||||
}
|
||||
Owner.EnsureComponentWarn(out PowerSupplierComponent _);
|
||||
|
||||
UpdateSupply();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user