- fix: Store fixes

This commit is contained in:
Aviu00
2024-02-05 11:20:08 +03:00
parent 22db173b81
commit cd701416ef
3 changed files with 8 additions and 4 deletions

View File

@@ -84,6 +84,10 @@ public sealed partial class StoreComponent : Component
[DataField]
public EntityUid? StartingMap;
// Miracle
[DataField]
public bool Refunds;
#region audio
/// <summary>
/// The sound played to the buyer when a purchase is succesfully made.

View File

@@ -163,7 +163,7 @@ public sealed partial class StoreSystem
}
}
if (!IsOnStartingMap(uid, component))
if (!IsOnStartingMap(uid, component) || !component.Refunds) // Miracle edit
component.RefundAllowed = false;
else
component.RefundAllowed = true;
@@ -331,7 +331,7 @@ public sealed partial class StoreSystem
if (args.Session.AttachedEntity is not { Valid: true } buyer)
return;
if (!IsOnStartingMap(uid, component))
if (!IsOnStartingMap(uid, component) || !component.Refunds) // Miracle edit
{
component.RefundAllowed = false;
UpdateUserInterface(buyer, uid, component);
@@ -340,7 +340,7 @@ public sealed partial class StoreSystem
if (!component.RefundAllowed || component.BoughtEntities.Count == 0)
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];

View File

@@ -157,7 +157,7 @@
- type: Store
preset: StorePresetUplink
balance:
Telecrystal: 10
Telecrystal: 0
- type: UserInterface
interfaces:
- key: enum.StoreUiKey.Key