返回提交历史
Modified
src/controllers/api/inventoryController.ts
+19
-1
XFEstudio/SpaceNinjaServer
chore: give pre-U18.16 users right side equivalents of sentinel wings (#3991)
Closes #3989 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3991 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
b3c5d13e
代码差异
1 个文件
+19
-1
@@ -38,7 +38,7 @@ import {
38
38
PRE_U40_MAX_KUBROW_EGGS
39
39
} from "../../services/inventoryService.ts";
40
40
import { logger } from "../../utils/logger.ts";
41
import { addString } from "../../helpers/stringHelpers.ts";
41
import { addString, catBreadHash } from "../../helpers/stringHelpers.ts";
42
42
import { Types, type FlattenMaps } from "mongoose";
43
43
import { getNemesisManifest } from "../../helpers/nemesisHelpers.ts";
44
44
import { getPersonalRooms } from "../../services/personalRoomsService.ts";
@@ -752,6 +752,24 @@ export const getInventoryResponse = async (
752
752
toLegacyDate(inventoryResponse.TrainingDate);
753
753
toLegacyDate(inventoryResponse.NextRefill!);
754
754
755
if (version_compare(buildLabel, gameToBuildVersion["18.16.0"]) < 0) {
756
const rightSkins = [];
757
for (const item of inventoryResponse.WeaponSkins) {
758
if (item.ItemType.startsWith("/Lotus/Upgrades/Skins/Sentinels/Wings/")) {
759
rightSkins.push(item.ItemType + "Right");
760
}
761
}
762
for (const itemType of rightSkins) {
763
inventoryResponse.WeaponSkins.push({
764
ItemType: itemType,
765
ItemId: toOid2(
766
"ca70ca70ca70ca70" + catBreadHash(itemType).toString(16).padStart(8, "0"),
767
buildLabel
768
)
769
});
770
}
771
}
772
755
773
if (version_compare(buildLabel, "2014.02.05.00.00") < 0) {
756
774
// Pre-U12 builds store mods in an array called Cards, and have no concept of RawUpgrades
757
775
inventoryResponse.Cards = [];