forked from OpenWF/SpaceNinjaServer
		
	fix: purchasing of augment mods (#595)
This commit is contained in:
		
							parent
							
								
									7b2c32b723
								
							
						
					
					
						commit
						c6ed013e23
					
				@ -36,7 +36,8 @@ import {
 | 
				
			|||||||
    ExportCustoms,
 | 
					    ExportCustoms,
 | 
				
			||||||
    ExportFlavour,
 | 
					    ExportFlavour,
 | 
				
			||||||
    ExportRecipes,
 | 
					    ExportRecipes,
 | 
				
			||||||
    ExportResources
 | 
					    ExportResources,
 | 
				
			||||||
 | 
					    ExportUpgrades
 | 
				
			||||||
} from "warframe-public-export-plus";
 | 
					} from "warframe-public-export-plus";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const createInventory = async (
 | 
					export const createInventory = async (
 | 
				
			||||||
@ -169,6 +170,22 @@ export const addItem = async (
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        return { InventoryChanges };
 | 
					        return { InventoryChanges };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    if (typeName in ExportUpgrades) {
 | 
				
			||||||
 | 
					        const inventory = await getInventory(accountId);
 | 
				
			||||||
 | 
					        const changes = [
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                ItemType: typeName,
 | 
				
			||||||
 | 
					                ItemCount: quantity
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        ];
 | 
				
			||||||
 | 
					        addMods(inventory, changes);
 | 
				
			||||||
 | 
					        await inventory.save();
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            InventoryChanges: {
 | 
				
			||||||
 | 
					                RawUpgrades: changes
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Path-based duck typing
 | 
					    // Path-based duck typing
 | 
				
			||||||
    switch (typeName.substr(1).split("/")[1]) {
 | 
					    switch (typeName.substr(1).split("/")[1]) {
 | 
				
			||||||
@ -228,22 +245,6 @@ export const addItem = async (
 | 
				
			|||||||
                    [weaponType]: [weapon]
 | 
					                    [weaponType]: [weapon]
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        case "Upgrades": {
 | 
					 | 
				
			||||||
            const inventory = await getInventory(accountId);
 | 
					 | 
				
			||||||
            const changes = [
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    ItemType: typeName,
 | 
					 | 
				
			||||||
                    ItemCount: quantity
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            ];
 | 
					 | 
				
			||||||
            addMods(inventory, changes);
 | 
					 | 
				
			||||||
            await inventory.save();
 | 
					 | 
				
			||||||
            return {
 | 
					 | 
				
			||||||
                InventoryChanges: {
 | 
					 | 
				
			||||||
                    RawUpgrades: changes
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        case "Objects": {
 | 
					        case "Objects": {
 | 
				
			||||||
            // /Lotus/Objects/Tenno/Props/TnoLisetTextProjector (Note Beacon)
 | 
					            // /Lotus/Objects/Tenno/Props/TnoLisetTextProjector (Note Beacon)
 | 
				
			||||||
            const inventory = await getInventory(accountId);
 | 
					            const inventory = await getInventory(accountId);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user