forked from OpenWF/SpaceNinjaServer
		
	fix: syndicate initiation (#2149)
Was accidentially broken by 1979b20f8cc00b79f305478f1da3d69f90a3d43e Reviewed-on: OpenWF/SpaceNinjaServer#2149 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
							
								
									62eeb313ec
								
							
						
					
					
						commit
						54a73ad5d7
					
				@ -20,8 +20,8 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
 | 
			
		||||
 | 
			
		||||
    const oldLevel = syndicate.Title ?? 0;
 | 
			
		||||
    const levelIncrease = data.SacrificeLevel - oldLevel;
 | 
			
		||||
    if (levelIncrease < 1) {
 | 
			
		||||
        throw new Error(`syndicate sacrifice needs an increase of at least 1`);
 | 
			
		||||
    if (levelIncrease < 0) {
 | 
			
		||||
        throw new Error(`syndicate sacrifice can not decrease level`);
 | 
			
		||||
    }
 | 
			
		||||
    if (levelIncrease > 1 && !data.AllowMultiple) {
 | 
			
		||||
        throw new Error(`desired syndicate level is an increase of ${levelIncrease}, max. allowed increase is 1`);
 | 
			
		||||
@ -37,7 +37,7 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
 | 
			
		||||
 | 
			
		||||
    // Process sacrifices and rewards for every level we're reaching
 | 
			
		||||
    const manifest = ExportSyndicates[data.AffiliationTag];
 | 
			
		||||
    for (let level = oldLevel + 1; level <= data.SacrificeLevel; ++level) {
 | 
			
		||||
    for (let level = oldLevel + levelIncrease; level <= data.SacrificeLevel; ++level) {
 | 
			
		||||
        let sacrifice: ISyndicateSacrifice | undefined;
 | 
			
		||||
        if (level == 0) {
 | 
			
		||||
            sacrifice = manifest.initiationSacrifice;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user