From 580640150285e1f90f25ca014991c09f2fed3cdc Mon Sep 17 00:00:00 2001 From: ArchPigeon Date: Sat, 24 Feb 2024 21:40:49 -0500 Subject: [PATCH] Remove the ability for command or any antag-safe role from being initial infected in zombie mode (#25529) Remove the ability for command to be initial infected in zombie mode --- Content.Server/GameTicking/Rules/ZombieRuleSystem.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs index 886ff965c7..9bfdb05d31 100644 --- a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs @@ -7,6 +7,7 @@ using Content.Server.GameTicking.Rules.Components; using Content.Server.Popups; using Content.Server.Preferences.Managers; using Content.Server.Roles; +using Content.Server.Roles.Jobs; using Content.Server.RoundEnd; using Content.Server.Station.Components; using Content.Server.Station.Systems; @@ -49,6 +50,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem [Dependency] private readonly SharedRoleSystem _roles = default!; [Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly JobSystem _jobs = default!; public override void Initialize() { @@ -271,7 +273,8 @@ public sealed class ZombieRuleSystem : GameRuleSystem var prefList = new List(); foreach (var player in allPlayers) { - if (player.AttachedEntity == null || !HasComp(player.AttachedEntity) || HasComp(player.AttachedEntity)) + if (player.AttachedEntity == null || !HasComp(player.AttachedEntity) || + HasComp(player.AttachedEntity) || !_jobs.CanBeAntag(player)) continue; if (HasComp(player.AttachedEntity)) -- 2.52.0