]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Vending machine popup prediction (#36622)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Wed, 16 Apr 2025 19:39:14 +0000 (05:39 +1000)
committerGitHub <noreply@github.com>
Wed, 16 Apr 2025 19:39:14 +0000 (15:39 -0400)
Title.

Content.Shared/VendingMachines/SharedVendingMachineSystem.Restock.cs

index de57189bc76f7b1c64daf6820d5f187fc3cef126..a5e2a6ecccc1a6dcadc6fd9287e19038ac73c8f6 100644 (file)
@@ -16,14 +16,11 @@ public abstract partial class SharedVendingMachineSystem
     {
         if (!TryComp<WiresPanelComponent>(target, out var panel) || !panel.Open)
         {
-            if (_net.IsServer)
-            {
-                Popup.PopupCursor(Loc.GetString("vending-machine-restock-needs-panel-open",
-                        ("this", uid),
-                        ("user", user),
-                        ("target", target)),
-                    user);
-            }
+            Popup.PopupCursor(Loc.GetString("vending-machine-restock-needs-panel-open",
+                    ("this", uid),
+                    ("user", user),
+                    ("target", target)),
+                user);
 
             return false;
         }
@@ -39,11 +36,8 @@ public abstract partial class SharedVendingMachineSystem
     {
         if (!component.CanRestock.Contains(machineComponent.PackPrototypeId))
         {
-            if (_net.IsServer)
-            {
-                Popup.PopupCursor(Loc.GetString("vending-machine-restock-invalid-inventory", ("this", uid), ("user", user),
-                        ("target", target)), user);
-            }
+            Popup.PopupCursor(Loc.GetString("vending-machine-restock-invalid-inventory", ("this", uid), ("user", user),
+                ("target", target)), user);
 
             return false;
         }
@@ -78,13 +72,11 @@ public abstract partial class SharedVendingMachineSystem
         if (!_doAfter.TryStartDoAfter(doAfterArgs))
             return;
 
-        if (_net.IsServer)
-        {
-            Popup.PopupEntity(Loc.GetString("vending-machine-restock-start", ("this", uid), ("user", args.User),
-                    ("target", target)),
-                args.User,
-                PopupType.Medium);
-        }
+        Popup.PopupPredicted(Loc.GetString("vending-machine-restock-start", ("this", uid), ("user", args.User),
+                ("target", target)),
+            uid,
+            args.User,
+            PopupType.Medium);
 
         Audio.PlayPredicted(component.SoundRestockStart, uid, args.User);
     }