forked from OpenWF/SpaceNinjaServer
		
	fix: additional checks in bounty rewards (#1626)
Reviewed-on: OpenWF/SpaceNinjaServer#1626 Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									8ebb749732
								
							
						
					
					
						commit
						43f3917b09
					
				@ -922,7 +922,7 @@ function getRandomMissionDrops(RewardInfo: IRewardInfo, tierOverride: number | u
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                        if (syndicateEntry.Tag === "EntratiSyndicate") {
 | 
					                        if (syndicateEntry.Tag === "EntratiSyndicate") {
 | 
				
			||||||
                            const vault = syndicateEntry.Jobs.find(j => j.locationTag === locationTag);
 | 
					                            const vault = syndicateEntry.Jobs.find(j => j.locationTag === locationTag);
 | 
				
			||||||
                            if (vault) job = vault;
 | 
					                            if (vault && locationTag) job = vault;
 | 
				
			||||||
                            // if (
 | 
					                            // if (
 | 
				
			||||||
                            //     [
 | 
					                            //     [
 | 
				
			||||||
                            //         "DeimosRuinsExterminateBounty",
 | 
					                            //         "DeimosRuinsExterminateBounty",
 | 
				
			||||||
@ -997,8 +997,10 @@ function getRandomMissionDrops(RewardInfo: IRewardInfo, tierOverride: number | u
 | 
				
			|||||||
                            (RewardInfo.JobStage === job.xpAmounts.length - 1 || job.isVault) &&
 | 
					                            (RewardInfo.JobStage === job.xpAmounts.length - 1 || job.isVault) &&
 | 
				
			||||||
                            !isEndlessJob
 | 
					                            !isEndlessJob
 | 
				
			||||||
                        ) {
 | 
					                        ) {
 | 
				
			||||||
                            rewardManifests.push(job.rewards);
 | 
					                            if (ExportRewards[job.rewards]) {
 | 
				
			||||||
                            rotations.push(ExportRewards[job.rewards].length - 1);
 | 
					                                rewardManifests.push(job.rewards);
 | 
				
			||||||
 | 
					                                rotations.push(ExportRewards[job.rewards].length - 1);
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
@ -1053,17 +1055,20 @@ function getRandomMissionDrops(RewardInfo: IRewardInfo, tierOverride: number | u
 | 
				
			|||||||
        if (rewardManifests.length != 0) {
 | 
					        if (rewardManifests.length != 0) {
 | 
				
			||||||
            logger.debug(`generating random mission rewards`, { rewardManifests, rotations });
 | 
					            logger.debug(`generating random mission rewards`, { rewardManifests, rotations });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        rewardManifests
 | 
					        rewardManifests.forEach(name => {
 | 
				
			||||||
            .map(name => ExportRewards[name])
 | 
					            const table = ExportRewards[name];
 | 
				
			||||||
            .forEach(table => {
 | 
					            if (!table) {
 | 
				
			||||||
                for (const rotation of rotations) {
 | 
					                logger.error(`unknown droptable: ${name}`);
 | 
				
			||||||
                    const rotationRewards = table[rotation];
 | 
					                return;
 | 
				
			||||||
                    const drop = getRandomRewardByChance(rotationRewards);
 | 
					            }
 | 
				
			||||||
                    if (drop) {
 | 
					            for (const rotation of rotations) {
 | 
				
			||||||
                        drops.push({ StoreItem: drop.type, ItemCount: drop.itemCount });
 | 
					                const rotationRewards = table[rotation];
 | 
				
			||||||
                    }
 | 
					                const drop = getRandomRewardByChance(rotationRewards);
 | 
				
			||||||
 | 
					                if (drop) {
 | 
				
			||||||
 | 
					                    drops.push({ StoreItem: drop.type, ItemCount: drop.itemCount });
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            });
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (region.cacheRewardManifest && RewardInfo.EnemyCachesFound) {
 | 
					        if (region.cacheRewardManifest && RewardInfo.EnemyCachesFound) {
 | 
				
			||||||
            const deck = ExportRewards[region.cacheRewardManifest];
 | 
					            const deck = ExportRewards[region.cacheRewardManifest];
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user