- fix: Store fixes
This commit is contained in:
@@ -84,6 +84,10 @@ public sealed partial class StoreComponent : Component
|
|||||||
[DataField]
|
[DataField]
|
||||||
public EntityUid? StartingMap;
|
public EntityUid? StartingMap;
|
||||||
|
|
||||||
|
// Miracle
|
||||||
|
[DataField]
|
||||||
|
public bool Refunds;
|
||||||
|
|
||||||
#region audio
|
#region audio
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The sound played to the buyer when a purchase is succesfully made.
|
/// The sound played to the buyer when a purchase is succesfully made.
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ public sealed partial class StoreSystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsOnStartingMap(uid, component))
|
if (!IsOnStartingMap(uid, component) || !component.Refunds) // Miracle edit
|
||||||
component.RefundAllowed = false;
|
component.RefundAllowed = false;
|
||||||
else
|
else
|
||||||
component.RefundAllowed = true;
|
component.RefundAllowed = true;
|
||||||
@@ -331,7 +331,7 @@ public sealed partial class StoreSystem
|
|||||||
if (args.Session.AttachedEntity is not { Valid: true } buyer)
|
if (args.Session.AttachedEntity is not { Valid: true } buyer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!IsOnStartingMap(uid, component))
|
if (!IsOnStartingMap(uid, component) || !component.Refunds) // Miracle edit
|
||||||
{
|
{
|
||||||
component.RefundAllowed = false;
|
component.RefundAllowed = false;
|
||||||
UpdateUserInterface(buyer, uid, component);
|
UpdateUserInterface(buyer, uid, component);
|
||||||
@@ -340,7 +340,7 @@ public sealed partial class StoreSystem
|
|||||||
if (!component.RefundAllowed || component.BoughtEntities.Count == 0)
|
if (!component.RefundAllowed || component.BoughtEntities.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (var i = component.BoughtEntities.Count; i >= 0; i--)
|
for (var i = component.BoughtEntities.Count - 1; i >= 0; i--) // MIRACLE FIX CRINGE
|
||||||
{
|
{
|
||||||
var purchase = component.BoughtEntities[i];
|
var purchase = component.BoughtEntities[i];
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,7 @@
|
|||||||
- type: Store
|
- type: Store
|
||||||
preset: StorePresetUplink
|
preset: StorePresetUplink
|
||||||
balance:
|
balance:
|
||||||
Telecrystal: 10
|
Telecrystal: 0
|
||||||
- type: UserInterface
|
- type: UserInterface
|
||||||
interfaces:
|
interfaces:
|
||||||
- key: enum.StoreUiKey.Key
|
- key: enum.StoreUiKey.Key
|
||||||
|
|||||||
Reference in New Issue
Block a user