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);