Store Refund - Add more disable scenerios & time to disable refund. (#34671)
* Puts disable refund logic into a helper method. Removes action check. Disables refund on action use. * Adds check if refund is disabled for the store already * Adds a way to disable refunds based on time * Checks if the ent is on the starting map and the end time is below the current time before disabling refund * Replaces instances of component.RefundAllowed = false with DisableRefund for more consistency and easier tracking * Adds methods to handle inhand and shooting events * Removes gamestates --------- Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
This commit is contained in:
@@ -164,7 +164,7 @@ public sealed partial class StoreSystem
|
||||
}
|
||||
|
||||
if (!IsOnStartingMap(uid, component))
|
||||
component.RefundAllowed = false;
|
||||
DisableRefund(uid, component);
|
||||
|
||||
//subtract the cash
|
||||
foreach (var (currency, amount) in cost)
|
||||
@@ -332,7 +332,7 @@ public sealed partial class StoreSystem
|
||||
|
||||
if (!IsOnStartingMap(uid, component))
|
||||
{
|
||||
component.RefundAllowed = false;
|
||||
DisableRefund(uid, component);
|
||||
UpdateUserInterface(buyer, uid, component);
|
||||
}
|
||||
|
||||
@@ -376,6 +376,7 @@ public sealed partial class StoreSystem
|
||||
component.BoughtEntities.Add(purchase);
|
||||
var refundComp = EnsureComp<StoreRefundComponent>(purchase);
|
||||
refundComp.StoreEntity = uid;
|
||||
refundComp.BoughtTime = _timing.CurTime;
|
||||
}
|
||||
|
||||
private bool IsOnStartingMap(EntityUid store, StoreComponent component)
|
||||
|
||||
Reference in New Issue
Block a user