forked from OpenWF/SpaceNinjaServer
		
	feat: handle miscItemFee in end of match upload (#1454)
Reviewed-on: OpenWF/SpaceNinjaServer#1454 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
							
								
									61062e433f
								
							
						
					
					
						commit
						c18abab9c4
					
				@ -77,6 +77,21 @@ export const addMissionInventoryUpdates = async (
 | 
			
		||||
    inventoryUpdates: IMissionInventoryUpdateRequest
 | 
			
		||||
): Promise<IInventoryChanges> => {
 | 
			
		||||
    const inventoryChanges: IInventoryChanges = {};
 | 
			
		||||
    if (
 | 
			
		||||
        inventoryUpdates.EndOfMatchUpload &&
 | 
			
		||||
        inventoryUpdates.Missions &&
 | 
			
		||||
        inventoryUpdates.Missions.Tag in ExportRegions
 | 
			
		||||
    ) {
 | 
			
		||||
        const node = ExportRegions[inventoryUpdates.Missions.Tag];
 | 
			
		||||
        if (node.miscItemFee) {
 | 
			
		||||
            addMiscItems(inventory, [
 | 
			
		||||
                {
 | 
			
		||||
                    ItemType: node.miscItemFee.ItemType,
 | 
			
		||||
                    ItemCount: node.miscItemFee.ItemCount * -1
 | 
			
		||||
                }
 | 
			
		||||
            ]);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (inventoryUpdates.RewardInfo) {
 | 
			
		||||
        if (inventoryUpdates.RewardInfo.periodicMissionTag) {
 | 
			
		||||
            const tag = inventoryUpdates.RewardInfo.periodicMissionTag;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user