]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make only advertise vendors say thanks for using (#23726)
authorlzk <124214523+lzk228@users.noreply.github.com>
Mon, 8 Jan 2024 08:54:05 +0000 (09:54 +0100)
committerGitHub <noreply@github.com>
Mon, 8 Jan 2024 08:54:05 +0000 (11:54 +0300)
* :trollface:

* :trollface: 2

Content.Server/VendingMachines/VendingMachineSystem.cs

index 79aac8bcd774cd530fa894f2b9a3f48ab9944550..4d3fc0b941a040bb32ba0904a994f1411d55ab63 100644 (file)
@@ -1,5 +1,6 @@
 using System.Linq;
 using System.Numerics;
+using Content.Server.Advertise;
 using Content.Server.Cargo.Systems;
 using Content.Server.Chat.Systems;
 using Content.Server.Emp;
@@ -386,8 +387,11 @@ namespace Content.Server.VendingMachines
                 _throwingSystem.TryThrow(ent, direction, vendComponent.NonLimitedEjectForce);
             }
 
-            // Send message after dispensing
-            _chat.TrySendInGameICMessage(uid, Loc.GetString("vending-machine-thanks", ("name", Name(uid))), InGameICChatType.Speak, true);
+            // Only vendors that advertise will send message after dispensing
+            if (TryComp<AdvertiseComponent>(uid, out var advertise))
+            {
+                _chat.TrySendInGameICMessage(uid, Loc.GetString("vending-machine-thanks", ("name", Name(uid))), InGameICChatType.Speak, true);
+            }
 
             vendComponent.NextItemToEject = null;
             vendComponent.ThrowNextItem = false;