fix: don't use path-based matching to add QuestKeys
All checks were successful
Build / build (20) (push) Successful in 34s
Build / build (18) (push) Successful in 58s
Build / build (22) (push) Successful in 1m11s
Build / build (18) (pull_request) Successful in 37s
Build / build (20) (pull_request) Successful in 56s
Build / build (22) (pull_request) Successful in 1m10s

This commit is contained in:
Sainan 2025-02-19 21:20:54 +01:00
parent 1413a6bcc2
commit 79db88d704

View File

@ -38,6 +38,7 @@ import {
ExportCustoms, ExportCustoms,
ExportFlavour, ExportFlavour,
ExportGear, ExportGear,
ExportKeys,
ExportRecipes, ExportRecipes,
ExportResources, ExportResources,
ExportSentinels, ExportSentinels,
@ -365,6 +366,19 @@ export const addItem = async (
} }
}; };
} }
if (typeName in ExportKeys) {
// Note: "/Lotus/Types/Keys/" contains some EmailItems and ShipFeatureItems
inventory.QuestKeys.push({ ItemType: typeName });
return {
InventoryChanges: {
QuestKeys: [
{
ItemType: typeName
}
]
}
};
}
// Path-based duck typing // Path-based duck typing
switch (typeName.substr(1).split("/")[1]) { switch (typeName.substr(1).split("/")[1]) {
@ -481,18 +495,6 @@ export const addItem = async (
} }
break; break;
} }
case "Keys": {
inventory.QuestKeys.push({ ItemType: typeName });
return {
InventoryChanges: {
QuestKeys: [
{
ItemType: typeName
}
]
}
};
}
case "NeutralCreatures": { case "NeutralCreatures": {
const horseIndex = inventory.Horses.push({ ItemType: typeName }); const horseIndex = inventory.Horses.push({ ItemType: typeName });
return { return {