Add missing WirePanel components (#16676)

This commit is contained in:
Leon Friedrich
2023-05-22 15:45:36 +12:00
committed by GitHub
parent 69e5fb53ec
commit 7a35b1f08e
30 changed files with 43 additions and 12 deletions

View File

@@ -237,10 +237,7 @@ public sealed class WiresSystem : SharedWiresSystem
private void OnWiresStartup(EntityUid uid, WiresComponent component, ComponentStartup args)
{
if (!String.IsNullOrEmpty(component.LayoutId))
SetOrCreateWireLayout(uid, component);
UpdateUserInterface(uid);
EnsureComp<WiresPanelComponent>(uid);
}
#endregion
@@ -498,17 +495,16 @@ public sealed class WiresSystem : SharedWiresSystem
private void OnMapInit(EntityUid uid, WiresComponent component, MapInitEvent args)
{
EnsureComp<WiresPanelComponent>(uid);
if (!string.IsNullOrEmpty(component.LayoutId))
SetOrCreateWireLayout(uid, component);
if (component.SerialNumber == null)
{
GenerateSerialNumber(uid, component);
}
if (component.WireSeed == 0)
{
component.WireSeed = _random.Next(1, int.MaxValue);
UpdateUserInterface(uid);
}
UpdateUserInterface(uid);
}
#endregion