From 838ba8053e8384d2a6830b78a2d80d79e0f1ba7a Mon Sep 17 00:00:00 2001 From: BIGZi0348 Date: Wed, 13 Nov 2024 20:31:05 +0300 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_Amour/RoleplayInfo/SharedRoleplaySystem.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Content.Shared/_Amour/RoleplayInfo/SharedRoleplaySystem.cs b/Content.Shared/_Amour/RoleplayInfo/SharedRoleplaySystem.cs index aa593e3fbc..e9a280698e 100644 --- a/Content.Shared/_Amour/RoleplayInfo/SharedRoleplaySystem.cs +++ b/Content.Shared/_Amour/RoleplayInfo/SharedRoleplaySystem.cs @@ -1,7 +1,5 @@ using System.Linq; using Content.Shared._Amour.HumanoidAppearanceExtension; -using Content.Shared.Examine; -using Content.Shared.Humanoid; namespace Content.Shared._Amour.RoleplayInfo; @@ -15,10 +13,12 @@ public abstract class SharedRoleplaySystem : EntitySystem private void OnHumanoidLoading(EntityUid uid, RoleplayInfoComponent component, HumanoidAppearanceLoadingEvent args) { component.Data = new List(args.Profile.RoleplayInfoData.Select(p => p.Value)); - if (component.Data.Count == 0) + if (component.Data.Count < 2) { - var erp = new RoleplayInfo(name: "erp", roleplaySelection: RoleplaySelection.No); - var noncon = new RoleplayInfo(name: "noncon", roleplaySelection: RoleplaySelection.No); + var erpField = component.Data.Find((x) => { return x.Name.ToLower() == "erp"; }); + var erp = new RoleplayInfo(name: "erp", roleplaySelection: erpField != null ? erpField.RoleplaySelection : RoleplaySelection.No); + var nonconField = component.Data.Find((x) => { return x.Name.ToLower() == "noncon"; }); + var noncon = new RoleplayInfo(name: "noncon", roleplaySelection: nonconField != null ? nonconField.RoleplaySelection : RoleplaySelection.No); component.Data = new List { erp, noncon }; } }