feat: trade fish for standing #681
@ -18,14 +18,14 @@ export const fishmongerController: RequestHandler = async (req, res) => {
|
||||
for (const part of fishData.dissectionParts!) {
|
||||
const partItem = miscItemChanges.find(x => x.ItemType == part.ItemType);
|
||||
if (partItem) {
|
||||
partItem.ItemCount += part.ItemCount;
|
||||
partItem.ItemCount += part.ItemCount * fish.ItemCount;
|
||||
} else {
|
||||
miscItemChanges.push(part);
|
||||
miscItemChanges.push({ ItemType: part.ItemType, ItemCount: part.ItemCount * fish.ItemCount });
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
syndicateTag = fishData.syndicateTag!;
|
||||
standingChange += fishData.standingBonus!;
|
||||
standingChange += fishData.standingBonus! * fish.ItemCount;
|
||||
}
|
||||
miscItemChanges.push({ ItemType: fish.ItemType, ItemCount: fish.ItemCount * -1 });
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user
💡 Codebase verification
Based on the code analysis, I can now provide a final response:
Validation needed for
fishData
accessThe code immediately uses
fishData.dissectionParts
without checking iffishData
exists, which could cause runtime errors. The validation is particularly important because:ExportResources
is accessed with a dynamic keyfish.ItemType
dissectionParts
propertypurchaseService
andinventoryService
implement existence checks within
operator before accessingExportResources
src/controllers/api/fishmongerController.ts:16
: Add null check before accessingfishData
🔗 Analysis chain
Verify existence of
fishData
Accessing
ExportResources[fish.ItemType]
without any check can cause errors iffish.ItemType
is missing from the export or is undefined. Consider adding a validation step or fallback logic.Let me gather information about the
ExportResources
and its usage to verify this concern.Let me analyze the usage of
ExportResources
to understand if we need validation. I'll search for its usage patterns and error handling.🏁 Scripts executed
The following scripts were executed for the analysis:
Error: No shell scripts found
Script:
Length of output: 87233
Script:
Length of output: 11028