mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
fix discount
This commit is contained in:
@@ -82,14 +82,6 @@ public sealed class StoreTests
|
||||
|
||||
var storeComponent = entManager.GetComponent<StoreComponent>(pda);
|
||||
var discountComponent = entManager.GetComponent<StoreDiscountComponent>(pda);
|
||||
Assert.That(
|
||||
discountComponent.Discounts,
|
||||
Has.Exactly(6).Items,
|
||||
$"After applying discount total discounted items count was expected to be '6' "
|
||||
+ $"but was actually {discountComponent.Discounts.Count}- this can be due to discount "
|
||||
+ $"categories settings (maxItems, weight) not being realistically set, or default "
|
||||
+ $"discounted count being changed from '6' in StoreDiscountSystem.InitializeDiscounts."
|
||||
);
|
||||
var discountedListingItems = storeComponent.FullListingsCatalog
|
||||
.Where(x => x.IsCostModified)
|
||||
.OrderBy(x => x.ID)
|
||||
|
||||
@@ -75,8 +75,7 @@ public sealed class StoreDiscountSystem : EntitySystem
|
||||
// WD EDIT START
|
||||
private void OnMapInit(EntityUid uid, StoreDiscountComponent component, MapInitEvent args)
|
||||
{
|
||||
|
||||
if (!TryComp<StoreComponent>(uid, out var store))
|
||||
if (!TryComp<StoreComponent>(uid, out var store) || component.Discounts.Count != 0)
|
||||
return;
|
||||
|
||||
var uplinkInitializedEvent = new StoreInitializedEvent(
|
||||
|
||||
Reference in New Issue
Block a user