fix: помогите

This commit is contained in:
Remuchi
2024-03-26 16:01:54 +07:00
parent 5e74f6ae53
commit ad78f747c1
7 changed files with 19 additions and 22 deletions

View File

@@ -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);
}
}
}
}
}