Equip clothing to preview dummies in the lobby.

This commit is contained in:
Pieter-Jan Briers
2020-01-20 09:20:36 +01:00
parent 03bfb22559
commit 75aa9541e0
7 changed files with 166 additions and 24 deletions

View File

@@ -265,14 +265,8 @@ namespace Content.Server.GameTicking
{
var gear = _prototypeManager.Index<StartingGearPrototype>(job.StartingGear).Equipment;
foreach (var (slotStr, equipmentStr) in gear)
foreach (var (slot, equipmentStr) in gear)
{
if (!Enum.TryParse(slotStr.ToUpper(), out EquipmentSlotDefines.Slots slot))
{
Logger.Error("{0} is an invalid equipment slot.", slotStr);
continue;
}
var equipmentEntity = _entityManager.SpawnEntity(equipmentStr, entity.Transform.GridPosition);
inventory.Equip(slot, equipmentEntity.GetComponent<ClothingComponent>());
}