]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Edible Verb Fixes (#39933)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Sat, 27 Sep 2025 21:20:31 +0000 (14:20 -0700)
committerGitHub <noreply@github.com>
Sat, 27 Sep 2025 21:20:31 +0000 (21:20 +0000)
* You cannot drink the cannot drink

* Undo that shit

* Whoops

* Fix test fails

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Content.Shared/Nutrition/EntitySystems/IngestionSystem.Utensils.cs
Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs
Resources/Prototypes/Entities/Clothing/Shoes/base_clothingshoes.yml

index dfdc03cfe6d98106afe5240d48d666e94c4efed4..a4ef8422bb08a9fbe145da00be11b94c564dc2c8 100644 (file)
@@ -43,7 +43,7 @@ public sealed partial class IngestionSystem
         RaiseLocalEvent(target, ref ev);
 
         //Prevents food usage with a wrong utensil
-        if ((ev.Types & utensil.Comp.Types) == 0)
+        if (ev.Types != UtensilType.None && (ev.Types & utensil.Comp.Types) == 0)
         {
             _popup.PopupClient(Loc.GetString("ingestion-try-use-wrong-utensil", ("verb", GetEdibleVerb(target)), ("food", target), ("utensil", utensil.Owner)), user, user);
             return true;
index caecc2797e607a4ace234584e6fe92fb0421cdce..d3271b7edbbb393df88348e60b303aff9bb79216 100644 (file)
@@ -177,8 +177,10 @@ public sealed partial class IngestionSystem : EntitySystem
     /// </summary>
     /// <param name="food">Entity being eaten</param>
     /// <param name="stomachs">Stomachs available to digest</param>
-    public bool IsDigestibleBy(EntityUid food, List<Entity<StomachComponent, OrganComponent>> stomachs)
+    /// <param name="popup">Should we also display popup text if it exists?</param>
+    public bool IsDigestibleBy(EntityUid food, List<Entity<StomachComponent, OrganComponent>> stomachs, out bool popup)
     {
+        popup = false;
         var ev = new IsDigestibleEvent();
         RaiseLocalEvent(food, ref ev);
 
@@ -210,6 +212,7 @@ public sealed partial class IngestionSystem : EntitySystem
         }
 
         // If we didn't find a stomach that can digest our food then it doesn't exist.
+        popup = true;
         return false;
     }
 
@@ -247,9 +250,9 @@ public sealed partial class IngestionSystem : EntitySystem
             return;
 
         // Can we digest the specific item we're trying to eat?
-        if (!IsDigestibleBy(args.Ingested, stomachs))
+        if (!IsDigestibleBy(args.Ingested, stomachs, out var popup))
         {
-            if (!args.Ingest)
+            if (!args.Ingest || !popup)
                 return;
 
             if (forceFed)
index a1c837e2082e4c4dcf5cb6420f1474c4f04f1c34..cd945af5e34fad68094a0fa50c3b590160007689 100644 (file)
     slots:
       item:
         name: clothing-boots-sidearm
+        priority: 4
         whitelist:
           tags:
           - Knife
           - Sidearm
-        priority: 4
 
 - type: entity
   abstract: true