Prevent non-inital infected from getting the succumb to zombie action (#27820)

* b

* Update ZombieRuleSystem.cs

* hi
This commit is contained in:
Mr. 27
2024-05-09 17:45:23 -04:00
committed by GitHub
parent 4231efc780
commit fe5f4162ac
4 changed files with 17 additions and 11 deletions

View File

@@ -64,9 +64,16 @@ namespace Content.Server.Zombies
SubscribeLocalEvent<PendingZombieComponent, MapInitEvent>(OnPendingMapInit);
SubscribeLocalEvent<IncurableZombieComponent, MapInitEvent>(OnPendingMapInit);
SubscribeLocalEvent<ZombifyOnDeathComponent, MobStateChangedEvent>(OnDamageChanged);
}
private void OnPendingMapInit(EntityUid uid, IncurableZombieComponent component, MapInitEvent args)
{
_actions.AddAction(uid, ref component.Action, component.ZombifySelfActionPrototype);
}
private void OnPendingMapInit(EntityUid uid, PendingZombieComponent component, MapInitEvent args)
{
if (_mobState.IsDead(uid))
@@ -77,7 +84,6 @@ namespace Content.Server.Zombies
component.NextTick = _timing.CurTime + TimeSpan.FromSeconds(1f);
component.GracePeriod = _random.Next(component.MinInitialInfectedGrace, component.MaxInitialInfectedGrace);
_actions.AddAction(uid, ref component.Action, component.ZombifySelfActionPrototype);
}
public override void Update(float frameTime)