Fix sericulture zombies (#40279)

fix sericulture zombies
This commit is contained in:
slarticodefast
2025-10-15 01:08:00 +02:00
committed by GitHub
parent f6972de87d
commit 111805c03b

View File

@@ -68,8 +68,8 @@ public abstract partial class SharedSericultureSystem : EntitySystem
private void OnSericultureStart(EntityUid uid, SericultureComponent comp, SericultureActionEvent args) private void OnSericultureStart(EntityUid uid, SericultureComponent comp, SericultureActionEvent args)
{ {
if (TryComp<HungerComponent>(uid, out var hungerComp) if (!TryComp<HungerComponent>(uid, out var hungerComp)
&& _hungerSystem.IsHungerBelowState(uid, || _hungerSystem.IsHungerBelowState(uid,
comp.MinHungerThreshold, comp.MinHungerThreshold,
_hungerSystem.GetHunger(hungerComp) - comp.HungerCost, _hungerSystem.GetHunger(hungerComp) - comp.HungerCost,
hungerComp)) hungerComp))
@@ -95,9 +95,9 @@ public abstract partial class SharedSericultureSystem : EntitySystem
if (args.Cancelled || args.Handled || comp.Deleted) if (args.Cancelled || args.Handled || comp.Deleted)
return; return;
if (TryComp<HungerComponent>(uid, if (!TryComp<HungerComponent>(uid,
out var hungerComp) // A check, just incase the doafter is somehow performed when the entity is not in the right hunger state. out var hungerComp) // A check, just incase the doafter is somehow performed when the entity is not in the right hunger state.
&& _hungerSystem.IsHungerBelowState(uid, || _hungerSystem.IsHungerBelowState(uid,
comp.MinHungerThreshold, comp.MinHungerThreshold,
_hungerSystem.GetHunger(hungerComp) - comp.HungerCost, _hungerSystem.GetHunger(hungerComp) - comp.HungerCost,
hungerComp)) hungerComp))
@@ -106,7 +106,7 @@ public abstract partial class SharedSericultureSystem : EntitySystem
return; return;
} }
_hungerSystem.ModifyHunger(uid, -comp.HungerCost); _hungerSystem.ModifyHunger(uid, -comp.HungerCost, hungerComp);
if (!_netManager.IsClient) // Have to do this because spawning stuff in shared is CBT. if (!_netManager.IsClient) // Have to do this because spawning stuff in shared is CBT.
{ {