]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixed Snacks Mispredicting on Clients (#38522)
authorSouthbridge <7013162+southbridge-fur@users.noreply.github.com>
Thu, 26 Jun 2025 20:32:36 +0000 (16:32 -0400)
committerGitHub <noreply@github.com>
Thu, 26 Jun 2025 20:32:36 +0000 (22:32 +0200)
* Well this works

* Removed merge conflict bait

* PredictedDel

* Apply suggestions from code review

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Content.Shared/Nutrition/EntitySystems/FoodSystem.cs

index 6099939725daa1fc60aaf46307b26299fc7deada..ee2c9f3a4a9cb3f3e8d472067d5360e4c4551850 100644 (file)
@@ -342,7 +342,7 @@ public sealed class FoodSystem : EntitySystem
 
         if (component.Trash.Count == 0)
         {
-            QueueDel(food);
+            PredictedQueueDel(food);
             return;
         }
 
@@ -353,10 +353,10 @@ public sealed class FoodSystem : EntitySystem
         var trashes = component.Trash;
         var tryPickup = _hands.IsHolding(user, food, out _);
 
-        Del(food);
+        PredictedDel(food);
         foreach (var trash in trashes)
         {
-            var spawnedTrash = Spawn(trash, position);
+            var spawnedTrash = EntityManager.PredictedSpawn(trash, position);
 
             // If the user is holding the item
             if (tryPickup)