EntityStorage ECS (#9291)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Server.Storage.EntitySystems;
|
||||
using Content.Shared.PDA;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
@@ -10,6 +11,7 @@ public sealed class SurplusBundleSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly EntityStorageSystem _entityStorage = default!;
|
||||
|
||||
private UplinkStoreListingPrototype[] _uplinks = default!;
|
||||
|
||||
@@ -31,13 +33,12 @@ public sealed class SurplusBundleSystem : EntitySystem
|
||||
|
||||
private void OnMapInit(EntityUid uid, SurplusBundleComponent component, MapInitEvent args)
|
||||
{
|
||||
FillStorage(uid, component: component);
|
||||
FillStorage(uid, component);
|
||||
}
|
||||
|
||||
private void FillStorage(EntityUid uid, IStorageComponent? storage = null,
|
||||
SurplusBundleComponent? component = null)
|
||||
private void FillStorage(EntityUid uid, SurplusBundleComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref storage, ref component))
|
||||
if (!Resolve(uid, ref component))
|
||||
return;
|
||||
|
||||
var cords = Transform(uid).Coordinates;
|
||||
@@ -46,7 +47,7 @@ public sealed class SurplusBundleSystem : EntitySystem
|
||||
foreach (var item in content)
|
||||
{
|
||||
var ent = EntityManager.SpawnEntity(item.ItemId, cords);
|
||||
storage.Insert(ent);
|
||||
_entityStorage.Insert(ent, component.Owner);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user