fix: помогите
This commit is contained in:
@@ -3,12 +3,11 @@ using Robust.Shared.Network;
|
||||
|
||||
namespace Content.Shared._White.Jukebox;
|
||||
|
||||
public class JukeboxSharedSystem : EntitySystem
|
||||
public sealed class JukeboxSharedSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly INetManager _netManager = default!;
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -17,8 +16,11 @@ public class JukeboxSharedSystem : EntitySystem
|
||||
|
||||
public void OnJukeboxInit(EntityUid uid, JukeboxComponent component, ComponentStartup args)
|
||||
{
|
||||
component.TapeContainer = _containerSystem.EnsureContainer<Container>(uid, JukeboxComponent.JukeboxContainerName);
|
||||
component.DefaultSongsContainer = _containerSystem.EnsureContainer<Container>(uid, JukeboxComponent.JukeboxDefaultSongsName);
|
||||
component.TapeContainer =
|
||||
_containerSystem.EnsureContainer<Container>(uid, JukeboxComponent.JukeboxContainerName);
|
||||
|
||||
component.DefaultSongsContainer =
|
||||
_containerSystem.EnsureContainer<Container>(uid, JukeboxComponent.JukeboxDefaultSongsName);
|
||||
|
||||
if (_netManager.IsServer)
|
||||
{
|
||||
@@ -28,10 +30,11 @@ public class JukeboxSharedSystem : EntitySystem
|
||||
{
|
||||
var tapeUid = EntityManager.SpawnEntity(tapePrototype, transform.MapPosition);
|
||||
|
||||
if(!TryComp<TapeComponent>(tapeUid, out _)) continue;
|
||||
if (!TryComp<TapeComponent>(tapeUid, out _))
|
||||
continue;
|
||||
|
||||
component.DefaultSongsContainer.Insert(tapeUid);
|
||||
_containerSystem.Insert(tapeUid, component.DefaultSongsContainer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user