From 1530d0bd26db5fa0326c05d8c2bf7f24967798b7 Mon Sep 17 00:00:00 2001 From: stilnat Date: Sat, 22 Jul 2023 17:14:31 +0200 Subject: [PATCH] fix return too soon --- .../Scripts/SS3D/Systems/Roles/RoleSystem.cs | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Assets/Scripts/SS3D/Systems/Roles/RoleSystem.cs b/Assets/Scripts/SS3D/Systems/Roles/RoleSystem.cs index d9ae086b9f..3627d008ff 100644 --- a/Assets/Scripts/SS3D/Systems/Roles/RoleSystem.cs +++ b/Assets/Scripts/SS3D/Systems/Roles/RoleSystem.cs @@ -200,38 +200,38 @@ private void SpawnLoadoutItems(Entity entity, RoleLoadout loadout) SpawnItemInSlot(loadout.LeftHandItem, loadout.LeftHand, hands.HandContainers[0]); SpawnItemInSlot(loadout.RightHandItem, loadout.RightHand, hands.HandContainers[1]); - if (!inventory.TryGetTypeContainer(ContainerType.ShoeRight, 0, out AttachedContainer ShoeRightContainer)) return; - SpawnItemInSlot(loadout.RightShoeItem, loadout.RightShoe, ShoeRightContainer); + if (inventory.TryGetTypeContainer(ContainerType.ShoeRight, 0, out AttachedContainer ShoeRightContainer)) + SpawnItemInSlot(loadout.RightShoeItem, loadout.RightShoe, ShoeRightContainer); - if (!inventory.TryGetTypeContainer(ContainerType.ShoeLeft, 0, out AttachedContainer ShoeLeftContainer)) return; - SpawnItemInSlot(loadout.LeftShoeItem, loadout.LeftShoe, ShoeLeftContainer); + if (inventory.TryGetTypeContainer(ContainerType.ShoeLeft, 0, out AttachedContainer ShoeLeftContainer)) + SpawnItemInSlot(loadout.LeftShoeItem, loadout.LeftShoe, ShoeLeftContainer); - if (!inventory.TryGetTypeContainer(ContainerType.Jumpsuit, 0, out AttachedContainer JumpsuitContainer)) return; - SpawnItemInSlot(loadout.JumpsuitItem, loadout.Jumpsuit, JumpsuitContainer); + if (inventory.TryGetTypeContainer(ContainerType.Jumpsuit, 0, out AttachedContainer JumpsuitContainer)) + SpawnItemInSlot(loadout.JumpsuitItem, loadout.Jumpsuit, JumpsuitContainer); - if (!inventory.TryGetTypeContainer(ContainerType.GloveLeft, 0, out AttachedContainer LeftGloveContainer)) return; - SpawnItemInSlot(loadout.LeftGloveItem, loadout.LeftGlove, LeftGloveContainer); + if (inventory.TryGetTypeContainer(ContainerType.GloveLeft, 0, out AttachedContainer LeftGloveContainer)) + SpawnItemInSlot(loadout.LeftGloveItem, loadout.LeftGlove, LeftGloveContainer); - if (!inventory.TryGetTypeContainer(ContainerType.GloveRight, 0, out AttachedContainer RightGloveContainer)) return; - SpawnItemInSlot(loadout.RightGloveItem, loadout.RightGlove, RightGloveContainer); + if (inventory.TryGetTypeContainer(ContainerType.GloveRight, 0, out AttachedContainer RightGloveContainer)) + SpawnItemInSlot(loadout.RightGloveItem, loadout.RightGlove, RightGloveContainer); - if (!inventory.TryGetTypeContainer(ContainerType.Head, 0, out AttachedContainer HatContainer)) return; - SpawnItemInSlot(loadout.HatItem, loadout.Hat, HatContainer); + if (inventory.TryGetTypeContainer(ContainerType.Head, 0, out AttachedContainer HatContainer)) + SpawnItemInSlot(loadout.HatItem, loadout.Hat, HatContainer); - if (!inventory.TryGetTypeContainer(ContainerType.Glasses, 0, out AttachedContainer GlassesContainer)) return; - SpawnItemInSlot(loadout.GlassesItem, loadout.Glasses, GlassesContainer); + if (inventory.TryGetTypeContainer(ContainerType.Glasses, 0, out AttachedContainer GlassesContainer)) + SpawnItemInSlot(loadout.GlassesItem, loadout.Glasses, GlassesContainer); - if (!inventory.TryGetTypeContainer(ContainerType.Pocket, 0, out AttachedContainer leftPocketContainer)) return; - SpawnItemInSlot(loadout.LeftPocketItem, loadout.LeftPocket, leftPocketContainer); + if (inventory.TryGetTypeContainer(ContainerType.Pocket, 0, out AttachedContainer leftPocketContainer)) + SpawnItemInSlot(loadout.LeftPocketItem, loadout.LeftPocket, leftPocketContainer); - if (!inventory.TryGetTypeContainer(ContainerType.Pocket, 1, out AttachedContainer rightPocketContainer)) return; - SpawnItemInSlot(loadout.RightPocketItem, loadout.RightPocket, rightPocketContainer); + if (inventory.TryGetTypeContainer(ContainerType.Pocket, 1, out AttachedContainer rightPocketContainer)) + SpawnItemInSlot(loadout.RightPocketItem, loadout.RightPocket, rightPocketContainer); - if (!inventory.TryGetTypeContainer(ContainerType.EarRight, 0, out AttachedContainer EarRightContainer)) return; - SpawnItemInSlot(loadout.RightEarItem, loadout.RightEar, EarRightContainer); + if (inventory.TryGetTypeContainer(ContainerType.EarRight, 0, out AttachedContainer EarRightContainer)) + SpawnItemInSlot(loadout.RightEarItem, loadout.RightEar, EarRightContainer); - if (!inventory.TryGetTypeContainer(ContainerType.EarLeft, 0, out AttachedContainer EarLeftContainer)) return; - SpawnItemInSlot(loadout.LeftEarItem, loadout.LeftEar, EarLeftContainer); + if (inventory.TryGetTypeContainer(ContainerType.EarLeft, 0, out AttachedContainer EarLeftContainer)) + SpawnItemInSlot(loadout.LeftEarItem, loadout.LeftEar, EarLeftContainer); }