]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix two zombie bugs (#34472)
authorIProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
Sat, 19 Apr 2025 00:38:33 +0000 (20:38 -0400)
committerGitHub <noreply@github.com>
Sat, 19 Apr 2025 00:38:33 +0000 (20:38 -0400)
* fix two zombie bugs

* add comment

Content.Server/Zombies/ZombieSystem.cs
Content.Shared/Zombies/PendingZombieComponent.cs
Resources/Prototypes/Entities/Mobs/Species/vox.yml

index e34ecb4ad5db1bf85a54909a8853c65e3a4c26d9..054bd0f6ecfba10202107a3d2ccd67e43d2cf5aa 100644 (file)
@@ -87,6 +87,13 @@ namespace Content.Server.Zombies
         private void OnPendingMapInit(EntityUid uid, IncurableZombieComponent component, MapInitEvent args)
         {
             _actions.AddAction(uid, ref component.Action, component.ZombifySelfActionPrototype);
+
+            if (HasComp<ZombieComponent>(uid) || HasComp<ZombieImmuneComponent>(uid))
+                return;
+
+            EnsureComp<PendingZombieComponent>(uid, out PendingZombieComponent pendingComp);
+
+            pendingComp.GracePeriod = _random.Next(pendingComp.MinInitialInfectedGrace, pendingComp.MaxInitialInfectedGrace);
         }
 
         private void OnPendingMapInit(EntityUid uid, PendingZombieComponent component, MapInitEvent args)
@@ -98,7 +105,6 @@ namespace Content.Server.Zombies
             }
 
             component.NextTick = _timing.CurTime + TimeSpan.FromSeconds(1f);
-            component.GracePeriod = _random.Next(component.MinInitialInfectedGrace, component.MaxInitialInfectedGrace);
         }
 
         public override void Update(float frameTime)
index 0fb61c84df11b1d3d2422819367c09848925b1b6..b199edeb005293428185f736036ab0063cdd5599 100644 (file)
@@ -17,7 +17,7 @@ public sealed partial class PendingZombieComponent : Component
     {
         DamageDict = new ()
         {
-            { "Poison", 0.2 },
+            { "Poison", 0.4 },
         }
     };
 
index dc93dc8fdffbc47d880cf5267e4d8496d079fb04..4703bfd06b06643ff70873c8d5724c0f0a8a5686 100644 (file)
@@ -43,7 +43,7 @@
     damage:
       types:
         Heat: -0.07
-        Poison: -0.2
+        Poison: -0.2 # needs to be less than the PendingZombieComponent does or they never become zombies by the disease.
       groups:
         Brute: -0.07
   - type: DamageVisuals