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:
@@ -249,10 +249,12 @@ public sealed partial class StoreSystem
|
|||||||
HandleRefundComp(uid, component, upgradeActionId.Value);
|
HandleRefundComp(uid, component, upgradeActionId.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//broadcast event
|
|
||||||
if (listing.ProductEvent != null)
|
if (listing.ProductEvent != null)
|
||||||
{
|
{
|
||||||
|
if (!listing.RaiseProductEventOnUser)
|
||||||
RaiseLocalEvent(listing.ProductEvent);
|
RaiseLocalEvent(listing.ProductEvent);
|
||||||
|
else
|
||||||
|
RaiseLocalEvent(buyer, listing.ProductEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
//log dat shit.
|
//log dat shit.
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ public partial class ListingData : IEquatable<ListingData>, ICloneable
|
|||||||
[DataField("productEvent")]
|
[DataField("productEvent")]
|
||||||
public object? ProductEvent;
|
public object? ProductEvent;
|
||||||
|
|
||||||
|
[DataField]
|
||||||
|
public bool RaiseProductEventOnUser;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// used internally for tracking how many times an item was purchased.
|
/// used internally for tracking how many times an item was purchased.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -120,7 +123,7 @@ public partial class ListingData : IEquatable<ListingData>, ICloneable
|
|||||||
Description != listing.Description ||
|
Description != listing.Description ||
|
||||||
ProductEntity != listing.ProductEntity ||
|
ProductEntity != listing.ProductEntity ||
|
||||||
ProductAction != listing.ProductAction ||
|
ProductAction != listing.ProductAction ||
|
||||||
ProductEvent != listing.ProductEvent ||
|
ProductEvent?.GetType() != listing.ProductEvent?.GetType() ||
|
||||||
RestockTime != listing.RestockTime)
|
RestockTime != listing.RestockTime)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user