diff --git a/Content.Server/Store/Systems/StoreSystem.Ui.cs b/Content.Server/Store/Systems/StoreSystem.Ui.cs index a7490fd27ff..e60e11d9d16 100644 --- a/Content.Server/Store/Systems/StoreSystem.Ui.cs +++ b/Content.Server/Store/Systems/StoreSystem.Ui.cs @@ -250,10 +250,12 @@ private void OnBuyRequest(EntityUid uid, StoreComponent component, StoreBuyListi HandleRefundComp(uid, component, upgradeActionId.Value); } - //broadcast event if (listing.ProductEvent != null) { - RaiseLocalEvent(listing.ProductEvent); + if (!listing.RaiseProductEventOnUser) + RaiseLocalEvent(listing.ProductEvent); + else + RaiseLocalEvent(buyer, listing.ProductEvent); } //log dat shit. diff --git a/Content.Shared/Store/ListingPrototype.cs b/Content.Shared/Store/ListingPrototype.cs index 2f067afbeeb..25245327ce9 100644 --- a/Content.Shared/Store/ListingPrototype.cs +++ b/Content.Shared/Store/ListingPrototype.cs @@ -98,6 +98,9 @@ public partial class ListingData : IEquatable, ICloneable [DataField("productEvent")] public object? ProductEvent; + [DataField] + public bool RaiseProductEventOnUser; + /// /// used internally for tracking how many times an item was purchased. /// @@ -120,7 +123,7 @@ public bool Equals(ListingData? listing) Description != listing.Description || ProductEntity != listing.ProductEntity || ProductAction != listing.ProductAction || - ProductEvent != listing.ProductEvent || + ProductEvent?.GetType() != listing.ProductEvent?.GetType() || RestockTime != listing.RestockTime) return false;