forked from OpenWF/SpaceNinjaServer
		
	fix: subtract standing gained in missions from daily bin (#880)
Fixes #794 Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/880 Co-authored-by: Sainan <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>
This commit is contained in:
		
							parent
							
								
									edc3171eee
								
							
						
					
					
						commit
						53ce6ccce2
					
				@ -41,6 +41,7 @@ import {
 | 
				
			|||||||
    ExportRecipes,
 | 
					    ExportRecipes,
 | 
				
			||||||
    ExportResources,
 | 
					    ExportResources,
 | 
				
			||||||
    ExportSentinels,
 | 
					    ExportSentinels,
 | 
				
			||||||
 | 
					    ExportSyndicates,
 | 
				
			||||||
    ExportUpgrades,
 | 
					    ExportUpgrades,
 | 
				
			||||||
    ExportWeapons,
 | 
					    ExportWeapons,
 | 
				
			||||||
    TStandingLimitBin
 | 
					    TStandingLimitBin
 | 
				
			||||||
@ -1054,12 +1055,11 @@ export const addBooster = (ItemType: string, time: number, inventory: TInventory
 | 
				
			|||||||
export const updateSyndicate = (
 | 
					export const updateSyndicate = (
 | 
				
			||||||
    inventory: HydratedDocument<IInventoryDatabase, InventoryDocumentProps>,
 | 
					    inventory: HydratedDocument<IInventoryDatabase, InventoryDocumentProps>,
 | 
				
			||||||
    syndicateUpdate: IMissionInventoryUpdateRequest["AffiliationChanges"]
 | 
					    syndicateUpdate: IMissionInventoryUpdateRequest["AffiliationChanges"]
 | 
				
			||||||
) => {
 | 
					): void => {
 | 
				
			||||||
    syndicateUpdate?.forEach(affiliation => {
 | 
					    syndicateUpdate?.forEach(affiliation => {
 | 
				
			||||||
        const syndicate = inventory.Affiliations.find(x => x.Tag == affiliation.Tag);
 | 
					        const syndicate = inventory.Affiliations.find(x => x.Tag == affiliation.Tag);
 | 
				
			||||||
        if (syndicate !== undefined) {
 | 
					        if (syndicate !== undefined) {
 | 
				
			||||||
            syndicate.Standing =
 | 
					            syndicate.Standing += affiliation.Standing;
 | 
				
			||||||
                syndicate.Standing === undefined ? affiliation.Standing : syndicate.Standing + affiliation.Standing;
 | 
					 | 
				
			||||||
            syndicate.Title = syndicate.Title === undefined ? affiliation.Title : syndicate.Title + affiliation.Title;
 | 
					            syndicate.Title = syndicate.Title === undefined ? affiliation.Title : syndicate.Title + affiliation.Title;
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            inventory.Affiliations.push({
 | 
					            inventory.Affiliations.push({
 | 
				
			||||||
@ -1070,8 +1070,8 @@ export const updateSyndicate = (
 | 
				
			|||||||
                FreeFavorsUsed: []
 | 
					                FreeFavorsUsed: []
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        updateStandingLimit(inventory, ExportSyndicates[affiliation.Tag].dailyLimitBin, affiliation.Standing);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    return { AffiliationMods: [] };
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user