Add new entity spawn test & fix misc bugs (#19953)
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
using Content.Server.Spawners.Components;
|
||||
using Content.Server.Storage.Components;
|
||||
using Content.Shared.Prototypes;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Storage.EntitySystems;
|
||||
|
||||
@@ -25,10 +29,13 @@ public sealed partial class StorageSystem
|
||||
var spawnItems = EntitySpawnCollection.GetSpawns(component.Contents, Random);
|
||||
foreach (var item in spawnItems)
|
||||
{
|
||||
// No, you are not allowed to fill a container with entity spawners.
|
||||
DebugTools.Assert(!_prototype.Index<EntityPrototype>(item)
|
||||
.HasComponent(typeof(RandomSpawnerComponent)));
|
||||
var ent = EntityManager.SpawnEntity(item, coordinates);
|
||||
|
||||
// handle depending on storage component, again this should be unified after ECS
|
||||
if (entityStorageComp != null && EntityStorage.Insert(ent, uid))
|
||||
if (entityStorageComp != null && EntityStorage.Insert(ent, uid, entityStorageComp))
|
||||
continue;
|
||||
|
||||
if (storageComp != null && Insert(uid, ent, out _, storageComp: storageComp, playSound: false))
|
||||
|
||||
Reference in New Issue
Block a user