返回提交历史
Modified
src/services/itemDataService.ts
+4
-4
XFEstudio/XFESpaceNinjaServer
fix: getPrice for bundles (#3565)
Closes #3563 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3565 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
46a82fc7
代码差异
1 个文件
+4
-4
@@ -1066,10 +1066,12 @@ export const getPrice = (
1066
1066
usePremium: boolean,
1067
1067
buildLabel: string
1068
1068
): number => {
1069
const isBundle = storeItemName in ExportBundles;
1070
const internalName = isBundle ? storeItemName : fromStoreItem(storeItemName);
1069
1071
let price: number | undefined;
1070
1072
{
1071
1073
const { FlashSales } = getWorldState(buildLabel);
1072
const flashSale = FlashSales.find(s => s.TypeName == fromStoreItem(storeItemName));
1074
const flashSale = FlashSales.find(s => s.TypeName == internalName);
1073
1075
if (flashSale) {
1074
1076
if (usePremium && flashSale.PremiumOverride > 0) {
1075
1077
return flashSale.PremiumOverride * quantity;
@@ -1078,7 +1080,6 @@ export const getPrice = (
1078
1080
}
1079
1081
}
1080
1082
}
1081
const isBundle = storeItemName in ExportBundles;
1082
1083
const isBooster = storeItemName in ExportBoosters;
1083
1084
if (isBooster) {
1084
1085
price = 40 * (durability + 1);
@@ -1103,8 +1104,7 @@ export const getPrice = (
1103
1104
price = Math.round(sum * (1 - discount));
1104
1105
}
1105
1106
} else {
1106
const internalName = fromStoreItem(storeItemName);
1107
const boosterPack = getBoosterPack(fromStoreItem(storeItemName), buildLabel);
1107
const boosterPack = getBoosterPack(internalName, buildLabel);
1108
1108
const isBoosterPack = boosterPack !== undefined;
1109
1109
if (isBoosterPack) {
1110
1110
if (usePremium) price = boosterPack.platinumCost;