simplify this shit
This commit is contained in:
parent
16b5b62518
commit
143b53947a
@ -66,7 +66,7 @@ const missionInventoryUpdateController: RequestHandler = async (req, res): Promi
|
||||
TotalCredits,
|
||||
CreditsBonus,
|
||||
MissionCredits,
|
||||
...(FusionPoints !== undefined && { FusionPoints })
|
||||
FusionPoints
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("Error parsing JSON data:", err);
|
||||
|
@ -54,12 +54,10 @@ const combineRewardAndLootInventory = (
|
||||
const missionCredits = lootInventory.RegularCredits || 0;
|
||||
const creditsBonus = rewardInventory.RegularCredits || 0;
|
||||
const totalCredits = missionCredits + creditsBonus;
|
||||
const FusionPoints = (lootInventory.FusionPoints || 0) + (rewardInventory.FusionPoints || 0) || undefined;
|
||||
const FusionPoints = (lootInventory.FusionPoints || 0) + (rewardInventory.FusionPoints || 0);
|
||||
|
||||
lootInventory.RegularCredits = totalCredits;
|
||||
if (FusionPoints) {
|
||||
lootInventory.FusionPoints = FusionPoints;
|
||||
}
|
||||
inventoryFields.forEach((field: IInventoryFieldType) => {
|
||||
if (rewardInventory[field] && !lootInventory[field]) {
|
||||
lootInventory[field] = [];
|
||||
@ -72,7 +70,7 @@ const combineRewardAndLootInventory = (
|
||||
TotalCredits: [totalCredits, totalCredits],
|
||||
CreditsBonus: [creditsBonus, creditsBonus],
|
||||
MissionCredits: [missionCredits, missionCredits],
|
||||
...(FusionPoints !== undefined && { FusionPoints })
|
||||
FusionPoints: FusionPoints
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user