From ea58ebed504880cf3b84e408041d1f0298beb7ca Mon Sep 17 00:00:00 2001 From: Acruid Date: Mon, 9 Sep 2019 10:52:45 -0700 Subject: [PATCH] If the player mob does not have an InventoryComponent, don't spawn the default inventory items. Previously the items were blindly spawned in, and if they were not able to be equipped to the player, ended up at the map origin. --- Content.Server/GameTicking/GameTicker.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index 76726b6ceb..19aa4b5024 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Content.Server.GameObjects; @@ -262,11 +262,12 @@ namespace Content.Server.GameTicking private IEntity _spawnPlayerMob() { var entity = _entityManager.SpawnEntityAt(PlayerPrototypeName, _getLateJoinSpawnPoint()); - var shoes = _entityManager.SpawnEntity("ShoesItem"); - var uniform = _entityManager.SpawnEntity("UniformAssistant"); if (entity.TryGetComponent(out InventoryComponent inventory)) { + var uniform = _entityManager.SpawnEntity("UniformAssistant"); inventory.Equip(EquipmentSlotDefines.Slots.INNERCLOTHING, uniform.GetComponent()); + + var shoes = _entityManager.SpawnEntity("ShoesItem"); inventory.Equip(EquipmentSlotDefines.Slots.SHOES, shoes.GetComponent()); }