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: don't use path-based matching to add QuestKeys (#967)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/967 Co-authored-by: Sainan <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>

00a75a33
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +14 -12
Modified src/services/inventoryService.ts +14 -12
@@ -38,6 +38,7 @@ import {
38 38 ExportCustoms,
39 39 ExportFlavour,
40 40 ExportGear,
41 ExportKeys,
41 42 ExportRecipes,
42 43 ExportResources,
43 44 ExportSentinels,
@@ -365,6 +366,19 @@ export const addItem = async (
365 366 }
366 367 };
367 368 }
369 if (typeName in ExportKeys) {
370 // Note: "/Lotus/Types/Keys/" contains some EmailItems and ShipFeatureItems
371 inventory.QuestKeys.push({ ItemType: typeName });
372 return {
373 InventoryChanges: {
374 QuestKeys: [
375 {
376 ItemType: typeName
377 }
378 ]
379 }
380 };
381 }
368 382
369 383 // Path-based duck typing
370 384 switch (typeName.substr(1).split("/")[1]) {
@@ -481,18 +495,6 @@ export const addItem = async (
481 495 }
482 496 break;
483 497 }
484 case "Keys": {
485 inventory.QuestKeys.push({ ItemType: typeName });
486 return {
487 InventoryChanges: {
488 QuestKeys: [
489 {
490 ItemType: typeName
491 }
492 ]
493 }
494 };
495 }
496 498 case "NeutralCreatures": {
497 499 const horseIndex = inventory.Horses.push({ ItemType: typeName });
498 500 return {