avoid unnecessary cucling rewardManifests.forEach
All checks were successful
Build / build (pull_request) Successful in 1m10s

This commit is contained in:
AMelonInsideLemon 2025-10-25 10:05:41 +02:00
parent a5403ef1c0
commit 046c7d9cab

View File

@ -2082,7 +2082,11 @@ function getRandomMissionDrops(
tableIndex = 2;
}
if (jobType.startsWith("/Lotus/Types/Gameplay/NokkoColony/Jobs/NokkoJob")) {
if (RewardInfo.JobStage === job.xpAmounts.length - 1) rotations = [0, 1, 2];
if (RewardInfo.JobStage === job.xpAmounts.length - 1) {
rotations = [0, 1, 2];
} else {
rewardManifests = [];
}
} else {
rotations = [tableIndex];
}
@ -2183,24 +2187,22 @@ function getRandomMissionDrops(
logger.warn(`RewardSeed mismatch:`, { client: RewardInfo.rewardSeed, database: inventory.RewardSeed });
}
}
if (rotations.length > 1) {
const rng = new SRng(BigInt(RewardInfo.rewardSeed ?? generateRewardSeed()) ^ 0xffffffffffffffffn);
rewardManifests.forEach(name => {
const table = ExportRewards[name];
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!table) {
logger.error(`unknown droptable: ${name}`);
return;
const rng = new SRng(BigInt(RewardInfo.rewardSeed ?? generateRewardSeed()) ^ 0xffffffffffffffffn);
rewardManifests.forEach(name => {
const table = ExportRewards[name];
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!table) {
logger.error(`unknown droptable: ${name}`);
return;
}
for (const rotation of rotations) {
const rotationRewards = table[rotation];
const drop = getRandomRewardByChance(rotationRewards, rng);
if (drop) {
drops.push({ StoreItem: drop.type, ItemCount: drop.itemCount });
}
for (const rotation of rotations) {
const rotationRewards = table[rotation];
const drop = getRandomRewardByChance(rotationRewards, rng);
if (drop) {
drops.push({ StoreItem: drop.type, ItemCount: drop.itemCount });
}
}
});
}
}
});
// Railjack Abandoned Cache Rewards, Rotation A (Mandatory Objectives)
if (RewardInfo.POICompletions) {