XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

fix: scale MiscItem prices by quantity

ce94c78c
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +2 -2
Modified src/services/purchaseService.ts +2 -2
@@ -64,7 +64,7 @@ export const handlePurchase = async (purchaseRequest: IPurchaseRequest, accountI
64 64 for (const item of offer.itemPrices) {
65 65 const invItem: IMiscItem = {
66 66 ItemType: item.ItemType,
67 ItemCount: item.ItemCount * -1
67 ItemCount: item.ItemCount * purchaseRequest.PurchaseParams.Quantity * -1
68 68 };
69 69
70 70 addMiscItems(inventory, [invItem]);
@@ -74,7 +74,7 @@ export const handlePurchase = async (purchaseRequest: IPurchaseRequest, accountI
74 74 x => x.ItemType == item.ItemType
75 75 );
76 76 if (change) {
77 change.ItemCount -= item.ItemCount;
77 change.ItemCount += invItem.ItemCount;
78 78 } else {
79 79 (purchaseResponse.InventoryChanges.MiscItems as IMiscItem[]).push(invItem);
80 80 }