返回提交历史
Modified
src/services/purchaseService.ts
+15
-7
XFEstudio/SpaceNinjaServer
fix: buying flawed mods on iron wake doesn't consume credits (#1228)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1228
3986dac8
代码差异
1 个文件
+15
-7
@@ -175,13 +175,21 @@ export const handlePurchase = async (
175
175
if (purchaseRequest.PurchaseParams.SourceId! in ExportVendors) {
176
176
const vendor = ExportVendors[purchaseRequest.PurchaseParams.SourceId!];
177
177
const offer = vendor.items.find(x => x.storeItem == purchaseRequest.PurchaseParams.StoreItem);
178
if (offer && offer.itemPrices) {
179
handleItemPrices(
180
inventory,
181
offer.itemPrices,
182
purchaseRequest.PurchaseParams.Quantity,
183
purchaseResponse.InventoryChanges
184
);
178
if (offer) {
179
if (offer.credits) {
180
combineInventoryChanges(
181
purchaseResponse.InventoryChanges,
182
updateCurrency(inventory, offer.credits, false)
183
);
184
}
185
if (offer.itemPrices) {
186
handleItemPrices(
187
inventory,
188
offer.itemPrices,
189
purchaseRequest.PurchaseParams.Quantity,
190
purchaseResponse.InventoryChanges
191
);
192
}
185
193
}
186
194
}
187
195
break;