From 9bb9d36ac97b625d363b74d0692c6513f6bc89ff Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Fri, 19 Jul 2024 17:42:32 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=A1=D0=BF=D0=B0=D0=B2=D0=BD=20=D0=BC?= =?UTF-8?q?=D0=B0=D0=B3=D0=B0=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D0=B0?= =?UTF-8?q?=D0=B4=D0=BC=D0=B8=D0=BD=D0=B2=D0=B5=D1=80=D0=B1=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D1=8C=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= =?UTF-8?q?=D0=B5=D1=82=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D0=BA=D0=BE?= =?UTF-8?q?=D1=80=D1=80=D0=B5=D0=BA=D1=82=D0=BD=D0=BE=20(#465)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_White/Wizard/WizardRuleSystem.cs | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Content.Server/_White/Wizard/WizardRuleSystem.cs b/Content.Server/_White/Wizard/WizardRuleSystem.cs index 170e1a3b54..e33eb21833 100644 --- a/Content.Server/_White/Wizard/WizardRuleSystem.cs +++ b/Content.Server/_White/Wizard/WizardRuleSystem.cs @@ -21,6 +21,7 @@ using Robust.Shared.Map; using Robust.Shared.Player; using Robust.Shared.Prototypes; using System.Linq; +using Content.Server.Administration.Commands; using Content.Server.Objectives; using Content.Server.Station.Components; using Content.Server.StationEvents.Components; @@ -280,7 +281,7 @@ public sealed class WizardRuleSystem : GameRuleSystem return true; } - private HumanoidCharacterProfile SetupWizardEntity( + private void SetupWizardEntity( EntityUid mob, StartingGearPrototype gear, bool endRoundOnDeath, @@ -311,14 +312,12 @@ public sealed class WizardRuleSystem : GameRuleSystem _humanoid.LoadProfile(mob, profile); _metaData.SetEntityName(mob, GetRandom(component.Name, "")); - } - _stationSpawning.EquipStartingGear(mob, gear); + _stationSpawning.EquipStartingGear(mob, gear); + } _npcFaction.RemoveFaction(mob, "NanoTrasen", false); _npcFaction.AddFaction(mob, "Wizard"); - - return profile; } private EntityCoordinates WizardSpawnPoint(WizardRuleComponent component) @@ -375,7 +374,8 @@ public sealed class WizardRuleSystem : GameRuleSystem return; } - var name = SetupWizardEntity(mob, gear, true).Name; + SetupWizardEntity(mob, gear, true); + var name = !TryComp(mob, out var meta) || meta.EntityName == "" ? "" : meta.EntityName; var newMind = _mind.CreateMind(session.UserId, name); _mind.SetUserId(newMind, session.UserId); @@ -468,7 +468,14 @@ public sealed class WizardRuleSystem : GameRuleSystem return false; } - SetupWizardEntity(wizard, gear, false); + if (!SpawnMap((wizard, rule))) + { + _sawmill.Info("Failed to load shuttle for wizard"); + return false; + } + + SetupWizardEntity(wizard, gear, false, false); + SetOutfitCommand.SetOutfit(wizard, gear.ID, EntityManager); var spawnpoint = WizardSpawnPoint(rule); var transform = EnsureComp(wizard);