fix: buying flawed mods on iron wake doesn't consume credits (#1228)

Reviewed-on: OpenWF/SpaceNinjaServer#1228
This commit is contained in:
Sainan 2025-03-20 05:36:17 -07:00
parent 0e1973e246
commit 3986dac8ef

View File

@ -175,13 +175,21 @@ export const handlePurchase = async (
if (purchaseRequest.PurchaseParams.SourceId! in ExportVendors) { if (purchaseRequest.PurchaseParams.SourceId! in ExportVendors) {
const vendor = ExportVendors[purchaseRequest.PurchaseParams.SourceId!]; const vendor = ExportVendors[purchaseRequest.PurchaseParams.SourceId!];
const offer = vendor.items.find(x => x.storeItem == purchaseRequest.PurchaseParams.StoreItem); const offer = vendor.items.find(x => x.storeItem == purchaseRequest.PurchaseParams.StoreItem);
if (offer && offer.itemPrices) { if (offer) {
handleItemPrices( if (offer.credits) {
inventory, combineInventoryChanges(
offer.itemPrices, purchaseResponse.InventoryChanges,
purchaseRequest.PurchaseParams.Quantity, updateCurrency(inventory, offer.credits, false)
purchaseResponse.InventoryChanges );
); }
if (offer.itemPrices) {
handleItemPrices(
inventory,
offer.itemPrices,
purchaseRequest.PurchaseParams.Quantity,
purchaseResponse.InventoryChanges
);
}
} }
} }
break; break;