forked from OpenWF/SpaceNinjaServer
		
	chore: remove empty ModularParts arrays from equipment (#2565)
Reviewed-on: OpenWF/SpaceNinjaServer#2565 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
							
								
									48e3f324e2
								
							
						
					
					
						commit
						522924a823
					
				@ -25,7 +25,8 @@ import {
 | 
				
			|||||||
    INemesisWeaponTargetFingerprint,
 | 
					    INemesisWeaponTargetFingerprint,
 | 
				
			||||||
    INemesisPetTargetFingerprint,
 | 
					    INemesisPetTargetFingerprint,
 | 
				
			||||||
    IDialogueDatabase,
 | 
					    IDialogueDatabase,
 | 
				
			||||||
    IKubrowPetPrintClient
 | 
					    IKubrowPetPrintClient,
 | 
				
			||||||
 | 
					    equipmentKeys
 | 
				
			||||||
} from "@/src/types/inventoryTypes/inventoryTypes";
 | 
					} from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
import { IGenericUpdate, IUpdateNodeIntrosResponse } from "@/src/types/genericUpdate";
 | 
					import { IGenericUpdate, IUpdateNodeIntrosResponse } from "@/src/types/genericUpdate";
 | 
				
			||||||
import { IKeyChainRequest, IMissionInventoryUpdateRequest } from "@/src/types/requestTypes";
 | 
					import { IKeyChainRequest, IMissionInventoryUpdateRequest } from "@/src/types/requestTypes";
 | 
				
			||||||
@ -2117,6 +2118,21 @@ export const cleanupInventory = (inventory: TInventoryDatabaseDocument): void =>
 | 
				
			|||||||
            inventory.LotusCustomization.syancol = {};
 | 
					            inventory.LotusCustomization.syancol = {};
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        let numFixed = 0;
 | 
				
			||||||
 | 
					        for (const equipmentKey of equipmentKeys) {
 | 
				
			||||||
 | 
					            for (const item of inventory[equipmentKey]) {
 | 
				
			||||||
 | 
					                if (item.ModularParts?.length === 0) {
 | 
				
			||||||
 | 
					                    item.ModularParts = undefined;
 | 
				
			||||||
 | 
					                    ++numFixed;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if (numFixed != 0) {
 | 
				
			||||||
 | 
					            logger.debug(`removed ModularParts from ${numFixed} non-modular items`);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const getDialogue = (inventory: TInventoryDatabaseDocument, dialogueName: string): IDialogueDatabase => {
 | 
					export const getDialogue = (inventory: TInventoryDatabaseDocument, dialogueName: string): IDialogueDatabase => {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user