Merge remote-tracking branch 'upstream/stable' into ed-11-12-2024-upstream
# Conflicts: # Content.IntegrationTests/Tests/PostMapInitTest.cs # Content.Shared/Lock/LockSystem.cs # Resources/Maps/oasis.yml # Resources/Prototypes/Maps/Pools/default.yml # Resources/Prototypes/audio.yml
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Shared.Actions;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Preferences.Loadouts;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Storage;
|
||||
@@ -71,7 +72,7 @@ public abstract class SharedStationSpawningSystem : EntitySystem
|
||||
|
||||
if (string.IsNullOrEmpty(name) && PrototypeManager.TryIndex(roleProto.NameDataset, out var nameData))
|
||||
{
|
||||
name = _random.Pick(nameData.Values);
|
||||
name = Loc.GetString(_random.Pick(nameData.Values));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
@@ -156,27 +157,23 @@ public abstract class SharedStationSpawningSystem : EntitySystem
|
||||
if (startingGear.Storage.Count > 0)
|
||||
{
|
||||
var coords = _xformSystem.GetMapCoordinates(entity);
|
||||
var ents = new ValueList<EntityUid>();
|
||||
_inventoryQuery.TryComp(entity, out var inventoryComp);
|
||||
|
||||
foreach (var (slot, entProtos) in startingGear.Storage)
|
||||
foreach (var (slotName, entProtos) in startingGear.Storage)
|
||||
{
|
||||
ents.Clear();
|
||||
if (entProtos.Count == 0)
|
||||
if (entProtos == null || entProtos.Count == 0)
|
||||
continue;
|
||||
|
||||
if (inventoryComp != null &&
|
||||
InventorySystem.TryGetSlotEntity(entity, slot, out var slotEnt, inventoryComponent: inventoryComp) &&
|
||||
InventorySystem.TryGetSlotEntity(entity, slotName, 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)
|
||||
foreach (var entProto in entProtos)
|
||||
{
|
||||
_storage.Insert(slotEnt.Value, ent, out _, storageComp: storage, playSound: false);
|
||||
var spawnedEntity = Spawn(entProto, coords);
|
||||
|
||||
_storage.Insert(slotEnt.Value, spawnedEntity, out _, storageComp: storage, playSound: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user