From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sun, 9 Jun 2024 13:53:03 +0000 (+1200) Subject: Make `MakeAntag()` log errors instead of throwing exceptions (#28771) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=ad9d18771e490019716ca94e0cd1b8f38cc9a91a;p=space-station-14.git Make `MakeAntag()` log errors instead of throwing exceptions (#28771) Make `MakeAntag()` log errors instead of throw --- diff --git a/Content.Server/Antag/AntagSelectionSystem.cs b/Content.Server/Antag/AntagSelectionSystem.cs index 55c66e8933..d2bc26f20d 100644 --- a/Content.Server/Antag/AntagSelectionSystem.cs +++ b/Content.Server/Antag/AntagSelectionSystem.cs @@ -264,7 +264,7 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem public void MakeAntag(Entity ent, ICommonSession? session, AntagSelectionDefinition def, bool ignoreSpawner = false) { - var antagEnt = (EntityUid?) null; + EntityUid? antagEnt = null; var isSpawner = false; if (session != null) @@ -285,17 +285,16 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem(player, out var spawnerComp)) { Log.Error($"Antag spawner {player} does not have a GhostRoleAntagSpawnerComponent."); + if (session != null) + ent.Comp.SelectedSessions.Remove(session); return; }