]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove the ability for command or any antag-safe role from being initial infected...
authorArchPigeon <bookmaster3@gmail.com>
Sun, 25 Feb 2024 02:40:49 +0000 (21:40 -0500)
committerGitHub <noreply@github.com>
Sun, 25 Feb 2024 02:40:49 +0000 (21:40 -0500)
Remove the ability for command to be initial infected in zombie mode

Content.Server/GameTicking/Rules/ZombieRuleSystem.cs

index 886ff965c722a6cba6e337453ce35a5449f80bf4..9bfdb05d3197f92b531f7d4a14b7d1798ada0cb9 100644 (file)
@@ -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<ZombieRuleComponent>
     [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<ZombieRuleComponent>
         var prefList = new List<ICommonSession>();
         foreach (var player in allPlayers)
         {
-            if (player.AttachedEntity == null || !HasComp<HumanoidAppearanceComponent>(player.AttachedEntity) || HasComp<ZombieImmuneComponent>(player.AttachedEntity))
+            if (player.AttachedEntity == null || !HasComp<HumanoidAppearanceComponent>(player.AttachedEntity) ||
+             HasComp<ZombieImmuneComponent>(player.AttachedEntity) || !_jobs.CanBeAntag(player))
                 continue;
 
             if (HasComp<InitialInfectedExemptComponent>(player.AttachedEntity))