]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix PlantHolder interactions & InteractionSystem assert (#32874)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Fri, 18 Oct 2024 05:40:36 +0000 (18:40 +1300)
committerGitHub <noreply@github.com>
Fri, 18 Oct 2024 05:40:36 +0000 (16:40 +1100)
Content.Server/Botany/Systems/PlantHolderSystem.cs
Content.Shared/Interaction/SharedInteractionSystem.cs

index b17c26137106b8750c97dd9d9217332ad6bc0a76..34d6a75bf252b9854aba5ed11603003367b71355 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Atmos.EntitySystems;
 using Content.Server.Botany.Components;
-using Content.Server.Fluids.Components;
 using Content.Server.Kitchen.Components;
 using Content.Server.Popups;
 using Content.Shared.Chemistry.EntitySystems;
@@ -11,7 +10,6 @@ using Content.Shared.Chemistry.Reagent;
 using Content.Shared.Coordinates.Helpers;
 using Content.Shared.Examine;
 using Content.Shared.FixedPoint;
-using Content.Shared.Fluids.Components;
 using Content.Shared.Hands.Components;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction;
@@ -19,7 +17,6 @@ using Content.Shared.Popups;
 using Content.Shared.Random;
 using Content.Shared.Tag;
 using Robust.Server.GameObjects;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
@@ -159,6 +156,7 @@ public sealed class PlantHolderSystem : EntitySystem
                 if (!_botany.TryGetSeed(seeds, out var seed))
                     return;
 
+                args.Handled = true;
                 var name = Loc.GetString(seed.Name);
                 var noun = Loc.GetString(seed.Noun);
                 _popup.PopupCursor(Loc.GetString("plant-holder-component-plant-success-message",
@@ -186,6 +184,7 @@ public sealed class PlantHolderSystem : EntitySystem
                 return;
             }
 
+            args.Handled = true;
             _popup.PopupCursor(Loc.GetString("plant-holder-component-already-seeded-message",
                 ("name", Comp<MetaDataComponent>(uid).EntityName)), args.User, PopupType.Medium);
             return;
@@ -193,6 +192,7 @@ public sealed class PlantHolderSystem : EntitySystem
 
         if (_tagSystem.HasTag(args.Used, "Hoe"))
         {
+            args.Handled = true;
             if (component.WeedLevel > 0)
             {
                 _popup.PopupCursor(Loc.GetString("plant-holder-component-remove-weeds-message",
@@ -212,6 +212,7 @@ public sealed class PlantHolderSystem : EntitySystem
 
         if (HasComp<ShovelComponent>(args.Used))
         {
+            args.Handled = true;
             if (component.Seed != null)
             {
                 _popup.PopupCursor(Loc.GetString("plant-holder-component-remove-plant-message",
@@ -231,6 +232,7 @@ public sealed class PlantHolderSystem : EntitySystem
 
         if (_tagSystem.HasTag(args.Used, "PlantSampleTaker"))
         {
+            args.Handled = true;
             if (component.Seed == null)
             {
                 _popup.PopupCursor(Loc.GetString("plant-holder-component-nothing-to-sample-message"), args.User);
@@ -286,10 +288,15 @@ public sealed class PlantHolderSystem : EntitySystem
         }
 
         if (HasComp<SharpComponent>(args.Used))
+        {
+            args.Handled = true;
             DoHarvest(uid, args.User, component);
+            return;
+        }
 
         if (TryComp<ProduceComponent>(args.Used, out var produce))
         {
+            args.Handled = true;
             _popup.PopupCursor(Loc.GetString("plant-holder-component-compost-message",
                 ("owner", uid),
                 ("usingItem", args.Used)), args.User, PopupType.Medium);
index 6f44d3089d1524597b045835ddddf79c7d1f8134..7f2ecb50f887364ac0eb13bb2b136706369f1260 100644 (file)
@@ -1372,7 +1372,8 @@ namespace Content.Shared.Interaction
             if (uidB == null || args?.Handled == false)
                 return;
 
-            DebugTools.AssertNotEqual(uidA, uidB.Value);
+            if (uidA == uidB.Value)
+                return;
 
             if (!TryComp(uidA, out MetaDataComponent? metaA) || metaA.EntityPaused)
                 return;