This commit is contained in:
Jabak
2024-07-19 19:55:19 +03:00
parent cf566a7d19
commit a5e3d2bfa1

View File

@@ -21,6 +21,7 @@ using Robust.Shared.Map;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using System.Linq; using System.Linq;
using Content.Server.Administration.Commands;
using Content.Server.Objectives; using Content.Server.Objectives;
using Content.Server.Station.Components; using Content.Server.Station.Components;
using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Components;
@@ -280,7 +281,7 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
return true; return true;
} }
private HumanoidCharacterProfile SetupWizardEntity( private void SetupWizardEntity(
EntityUid mob, EntityUid mob,
StartingGearPrototype gear, StartingGearPrototype gear,
bool endRoundOnDeath, bool endRoundOnDeath,
@@ -318,7 +319,6 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
_npcFaction.RemoveFaction(mob, "NanoTrasen", false); _npcFaction.RemoveFaction(mob, "NanoTrasen", false);
_npcFaction.AddFaction(mob, "Wizard"); _npcFaction.AddFaction(mob, "Wizard");
return profile;
} }
private EntityCoordinates WizardSpawnPoint(WizardRuleComponent component) private EntityCoordinates WizardSpawnPoint(WizardRuleComponent component)
@@ -375,7 +375,8 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
return; return;
} }
var name = SetupWizardEntity(mob, gear, true).Name; SetupWizardEntity(mob, gear, true);
var name = !TryComp<MetaDataComponent>(mob, out var meta) || meta.EntityName == "" ? "" : meta.EntityName;
var newMind = _mind.CreateMind(session.UserId, name); var newMind = _mind.CreateMind(session.UserId, name);
_mind.SetUserId(newMind, session.UserId); _mind.SetUserId(newMind, session.UserId);
@@ -468,7 +469,14 @@ public sealed class WizardRuleSystem : GameRuleSystem<WizardRuleComponent>
return false; 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 spawnpoint = WizardSpawnPoint(rule);
var transform = EnsureComp<TransformComponent>(wizard); var transform = EnsureComp<TransformComponent>(wizard);