Fixes store purchase events and adds support to raise a directed event (#26389)
* fixes store event check * raise directed product event
This commit is contained in:
parent
0303e9cb36
commit
4dced51f0d
2 changed files with 8 additions and 3 deletions
|
|
@ -249,10 +249,12 @@ public sealed partial class StoreSystem
|
|||
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.
|
||||
|
|
|
|||
|
|
@ -98,6 +98,9 @@ public partial class ListingData : IEquatable<ListingData>, ICloneable
|
|||
[DataField("productEvent")]
|
||||
public object? ProductEvent;
|
||||
|
||||
[DataField]
|
||||
public bool RaiseProductEventOnUser;
|
||||
|
||||
/// <summary>
|
||||
/// used internally for tracking how many times an item was purchased.
|
||||
/// </summary>
|
||||
|
|
@ -120,7 +123,7 @@ public partial class ListingData : IEquatable<ListingData>, ICloneable
|
|||
Description != listing.Description ||
|
||||
ProductEntity != listing.ProductEntity ||
|
||||
ProductAction != listing.ProductAction ||
|
||||
ProductEvent != listing.ProductEvent ||
|
||||
ProductEvent?.GetType() != listing.ProductEvent?.GetType() ||
|
||||
RestockTime != listing.RestockTime)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue