Make only advertise vendors say thanks for using (#23726)

* :trollface:

* :trollface: 2
This commit is contained in:
lzk
2024-01-08 09:54:05 +01:00
committed by GitHub
parent c861b66a47
commit 945a402d10

View 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;