Job starting gear is now defined in the starting gear rather than backpack prototypes (#27605)

*
This commit is contained in:
Mr. 27
2024-06-03 19:52:15 -04:00
committed by GitHub
parent 2ae5c953de
commit 7d22897d02
85 changed files with 729 additions and 1728 deletions

View File

@@ -15,9 +15,9 @@ public abstract class SharedStationSpawningSystem : EntitySystem
{
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
[Dependency] protected readonly InventorySystem InventorySystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly SharedStorageSystem _storage = default!;
[Dependency] private readonly SharedTransformSystem _xformSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly SharedStorageSystem _storage = default!;
[Dependency] private readonly SharedTransformSystem _xformSystem = default!;
private EntityQuery<HandsComponent> _handsQuery;
private EntityQuery<InventoryComponent> _inventoryQuery;
@@ -91,7 +91,7 @@ public abstract class SharedStationSpawningSystem : EntitySystem
if (!string.IsNullOrEmpty(equipmentStr))
{
var equipmentEntity = EntityManager.SpawnEntity(equipmentStr, xform.Coordinates);
InventorySystem.TryEquip(entity, equipmentEntity, slot.Name, silent: true, force:true);
InventorySystem.TryEquip(entity, equipmentEntity, slot.Name, silent: true, force: true);
}
}
}
@@ -122,15 +122,15 @@ public abstract class SharedStationSpawningSystem : EntitySystem
if (entProtos.Count == 0)
continue;
foreach (var ent in entProtos)
{
ents.Add(Spawn(ent, coords));
}
if (inventoryComp != null &&
InventorySystem.TryGetSlotEntity(entity, slot, out var slotEnt, inventoryComponent: inventoryComp) &&
_storageQuery.TryComp(slotEnt, out var storage))
{
foreach (var ent in entProtos)
{
ents.Add(Spawn(ent, coords));
}
foreach (var ent in ents)
{
_storage.Insert(slotEnt.Value, ent, out _, storageComp: storage, playSound: false);
@@ -145,4 +145,4 @@ public abstract class SharedStationSpawningSystem : EntitySystem
RaiseLocalEvent(entity, ref ev);
}
}
}
}