Fix two zombie bugs (#34472)

* fix two zombie bugs

* add comment
This commit is contained in:
IProduceWidgets
2025-04-18 20:38:33 -04:00
committed by GitHub
parent cfda91e0f0
commit d69738a9f4
3 changed files with 9 additions and 3 deletions

View File

@@ -87,6 +87,13 @@ namespace Content.Server.Zombies
private void OnPendingMapInit(EntityUid uid, IncurableZombieComponent component, MapInitEvent args) private void OnPendingMapInit(EntityUid uid, IncurableZombieComponent component, MapInitEvent args)
{ {
_actions.AddAction(uid, ref component.Action, component.ZombifySelfActionPrototype); _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) 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.NextTick = _timing.CurTime + TimeSpan.FromSeconds(1f);
component.GracePeriod = _random.Next(component.MinInitialInfectedGrace, component.MaxInitialInfectedGrace);
} }
public override void Update(float frameTime) public override void Update(float frameTime)

View File

@@ -17,7 +17,7 @@ public sealed partial class PendingZombieComponent : Component
{ {
DamageDict = new () DamageDict = new ()
{ {
{ "Poison", 0.2 }, { "Poison", 0.4 },
} }
}; };

View File

@@ -43,7 +43,7 @@
damage: damage:
types: types:
Heat: -0.07 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: groups:
Brute: -0.07 Brute: -0.07
- type: DamageVisuals - type: DamageVisuals