fix: buying flawed mods on iron wake doesn't consume credits (#1228)
Some checks failed
Build Docker image / docker (push) Waiting to run
Build / build (20) (push) Has been cancelled
Build / build (18) (push) Has been cancelled
Build / build (22) (push) Has been cancelled

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

View File

@ -175,7 +175,14 @@ 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) {
if (offer.credits) {
combineInventoryChanges(
purchaseResponse.InventoryChanges,
updateCurrency(inventory, offer.credits, false)
);
}
if (offer.itemPrices) {
handleItemPrices( handleItemPrices(
inventory, inventory,
offer.itemPrices, offer.itemPrices,
@ -184,6 +191,7 @@ export const handlePurchase = async (
); );
} }
} }
}
break; break;
case 18: { case 18: {
if (purchaseRequest.PurchaseParams.SourceId! != worldState.PrimeVaultTraders[0]._id.$oid) { if (purchaseRequest.PurchaseParams.SourceId! != worldState.PrimeVaultTraders[0]._id.$oid) {