Fix tutorial being skipped even with skipTutorial disabled
This commit is contained in:
		
							parent
							
								
									12b2ed45eb
								
							
						
					
					
						commit
						8c51e443af
					
				@ -49,17 +49,19 @@ export const createInventory = async (
 | 
			
		||||
    defaultItemReferences: { loadOutPresetId: Types.ObjectId; ship: Types.ObjectId }
 | 
			
		||||
) => {
 | 
			
		||||
    try {
 | 
			
		||||
        const inventory = new Inventory({
 | 
			
		||||
            ...new_inventory,
 | 
			
		||||
        const inventory = config.skipTutorial
 | 
			
		||||
            ? new Inventory({
 | 
			
		||||
                  accountOwnerId: accountOwnerId,
 | 
			
		||||
                  LoadOutPresets: defaultItemReferences.loadOutPresetId,
 | 
			
		||||
            Ships: [defaultItemReferences.ship]
 | 
			
		||||
                  Ships: [defaultItemReferences.ship],
 | 
			
		||||
                  ...new_inventory
 | 
			
		||||
              })
 | 
			
		||||
            : new Inventory({
 | 
			
		||||
                  accountOwnerId: accountOwnerId,
 | 
			
		||||
                  LoadOutPresets: defaultItemReferences.loadOutPresetId,
 | 
			
		||||
                  Ships: [defaultItemReferences.ship],
 | 
			
		||||
                  TrainingDate: 0
 | 
			
		||||
              });
 | 
			
		||||
        if (config.skipTutorial) {
 | 
			
		||||
            inventory.PlayedParkourTutorial = true;
 | 
			
		||||
            inventory.ReceivedStartingGear = true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        await inventory.save();
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
        if (error instanceof Error) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user