fix: only commit 'Missions' on successful completion (#2866)
Fixes SP missions being marked as completed when failing/quitting. Reviewed-on: #2866 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									30f380f37e
								
							
						
					
					
						commit
						f5c1b83598
					
				@ -309,9 +309,6 @@ export const addMissionInventoryUpdates = async (
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            case "Missions":
 | 
					 | 
				
			||||||
                addMissionComplete(inventory, value);
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            case "LastRegionPlayed":
 | 
					            case "LastRegionPlayed":
 | 
				
			||||||
                if (!(config.unfaithfulBugFixes?.ignore1999LastRegionPlayed && value === "1999MapName")) {
 | 
					                if (!(config.unfaithfulBugFixes?.ignore1999LastRegionPlayed && value === "1999MapName")) {
 | 
				
			||||||
                    inventory.LastRegionPlayed = value;
 | 
					                    inventory.LastRegionPlayed = value;
 | 
				
			||||||
@ -1208,6 +1205,9 @@ export const addMissionRewards = async (
 | 
				
			|||||||
    if (missions && missions.Tag in ExportRegions) {
 | 
					    if (missions && missions.Tag in ExportRegions) {
 | 
				
			||||||
        const node = ExportRegions[missions.Tag];
 | 
					        const node = ExportRegions[missions.Tag];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // cannot add this with normal updates because { Tier: 1 } would mark the SP node as completed even on a failure
 | 
				
			||||||
 | 
					        addMissionComplete(inventory, missions);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //node based credit rewards for mission completion
 | 
					        //node based credit rewards for mission completion
 | 
				
			||||||
        if (isEligibleForCreditReward(rewardInfo, missions, node)) {
 | 
					        if (isEligibleForCreditReward(rewardInfo, missions, node)) {
 | 
				
			||||||
            const levelCreditReward = getLevelCreditRewards(node);
 | 
					            const levelCreditReward = getLevelCreditRewards(node);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user