chore: simplify getExalted
This commit is contained in:
		
							parent
							
								
									7b894823cc
								
							
						
					
					
						commit
						c6c3e1c005
					
				@ -361,7 +361,7 @@ export const addSentinel = async (sentinelName: string, accountId: string) => {
 | 
			
		||||
 | 
			
		||||
export const addPowerSuit = async (powersuitName: string, accountId: string): Promise<IEquipmentClient> => {
 | 
			
		||||
    const specialItems = getExalted(powersuitName);
 | 
			
		||||
    if (specialItems != false) {
 | 
			
		||||
    if (specialItems) {
 | 
			
		||||
        for await (const specialItem of specialItems) {
 | 
			
		||||
            await addSpecialItem(specialItem, accountId);
 | 
			
		||||
        }
 | 
			
		||||
@ -374,7 +374,7 @@ export const addPowerSuit = async (powersuitName: string, accountId: string): Pr
 | 
			
		||||
 | 
			
		||||
export const addMechSuit = async (mechsuitName: string, accountId: string) => {
 | 
			
		||||
    const specialItems = getExalted(mechsuitName);
 | 
			
		||||
    if (specialItems != false) {
 | 
			
		||||
    if (specialItems) {
 | 
			
		||||
        for await (const specialItem of specialItems) {
 | 
			
		||||
            await addSpecialItem(specialItem, accountId);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -45,16 +45,11 @@ export const getRecipe = (uniqueName: string): IRecipe | undefined => {
 | 
			
		||||
    return ExportRecipes[uniqueName];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const getExalted = (uniqueName: string) => {
 | 
			
		||||
    const suit = getSuitByUniqueName(uniqueName);
 | 
			
		||||
    if (suit?.exalted !== undefined) {
 | 
			
		||||
        return suit.exalted;
 | 
			
		||||
    } else {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
export const getExalted = (uniqueName: string): string[] | undefined => {
 | 
			
		||||
    return getSuitByUniqueName(uniqueName)?.exalted;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const getItemCategoryByUniqueName = (uniqueName: string) => {
 | 
			
		||||
export const getItemCategoryByUniqueName = (uniqueName: string): string => {
 | 
			
		||||
    //Lotus/Types/Items/MiscItems/PolymerBundle
 | 
			
		||||
 | 
			
		||||
    let splitWord = "Items/";
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user