]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix sericulture zombies (#40279)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Tue, 14 Oct 2025 23:08:00 +0000 (01:08 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Oct 2025 23:08:00 +0000 (23:08 +0000)
fix sericulture zombies

Content.Shared/Sericulture/SericultureSystem.cs

index e6086e67c20d9c3d17a436e279a1e2daaa9a93e6..fb87c907f4d53d09c28184ee6d131245d9b47ceb 100644 (file)
@@ -68,8 +68,8 @@ public abstract partial class SharedSericultureSystem : EntitySystem
 
     private void OnSericultureStart(EntityUid uid, SericultureComponent comp, SericultureActionEvent args)
     {
-        if (TryComp<HungerComponent>(uid, out var hungerComp)
-            && _hungerSystem.IsHungerBelowState(uid,
+        if (!TryComp<HungerComponent>(uid, out var hungerComp)
+            || _hungerSystem.IsHungerBelowState(uid,
                 comp.MinHungerThreshold,
                 _hungerSystem.GetHunger(hungerComp) - comp.HungerCost,
                 hungerComp))
@@ -95,9 +95,9 @@ public abstract partial class SharedSericultureSystem : EntitySystem
         if (args.Cancelled || args.Handled || comp.Deleted)
             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.
-            && _hungerSystem.IsHungerBelowState(uid,
+            || _hungerSystem.IsHungerBelowState(uid,
                 comp.MinHungerThreshold,
                 _hungerSystem.GetHunger(hungerComp) - comp.HungerCost,
                 hungerComp))
@@ -106,7 +106,7 @@ public abstract partial class SharedSericultureSystem : EntitySystem
             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.
         {