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

SpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/SpaceNinjaServer

fix: exalted weapons should not be duplicated as they are shared (#645)

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

代码差异

1 个文件 +5 -2
Modified src/services/inventoryService.ts +5 -2
@@ -431,8 +431,11 @@ export const addMechSuit = async (mechsuitName: string, accountId: string) => {
431 431 return changedInventory.MechSuits[suitIndex - 1].toJSON();
432 432 };
433 433
434 export const addSpecialItem = async (itemName: string, accountId: string) => {
434 export const addSpecialItem = async (itemName: string, accountId: string): Promise<IEquipmentClient | undefined> => {
435 435 const inventory = await getInventory(accountId);
436 if (inventory.SpecialItems.find(x => x.ItemType == itemName)) {
437 return;
438 }
436 439 const specialItemIndex = inventory.SpecialItems.push({
437 440 ItemType: itemName,
438 441 Configs: [],
@@ -441,7 +444,7 @@ export const addSpecialItem = async (itemName: string, accountId: string) => {
441 444 XP: 0
442 445 });
443 446 const changedInventory = await inventory.save();
444 return changedInventory.SpecialItems[specialItemIndex - 1].toJSON();
447 return changedInventory.SpecialItems[specialItemIndex - 1].toJSON<IEquipmentClient>();
445 448 };
446 449
447 450 export const addSpaceSuit = async (spacesuitName: string, accountId: string) => {