From a5e3d2bfa17c9d6ce45c5cf5afdd5bbc30b4137a Mon Sep 17 00:00:00 2001 From: Jabak <163307958+Jabaks@users.noreply.github.com> Date: Fri, 19 Jul 2024 19:55:19 +0300 Subject: [PATCH] fix --- Content.Server/_White/Wizard/WizardRuleSystem.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Content.Server/_White/Wizard/WizardRuleSystem.cs b/Content.Server/_White/Wizard/WizardRuleSystem.cs index 170e1a3b54..2062083920 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, @@ -318,7 +319,6 @@ public sealed class WizardRuleSystem : GameRuleSystem _npcFaction.RemoveFaction(mob, "NanoTrasen", false); _npcFaction.AddFaction(mob, "Wizard"); - return profile; } private EntityCoordinates WizardSpawnPoint(WizardRuleComponent component) @@ -375,7 +375,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 +469,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);