fix: refuse to give starting gear again #1993
@ -149,6 +149,11 @@ export const addStartingGear = async (
 | 
				
			|||||||
    inventory: TInventoryDatabaseDocument,
 | 
					    inventory: TInventoryDatabaseDocument,
 | 
				
			||||||
    startingGear?: TPartialStartingGear
 | 
					    startingGear?: TPartialStartingGear
 | 
				
			||||||
): Promise<IInventoryChanges> => {
 | 
					): Promise<IInventoryChanges> => {
 | 
				
			||||||
 | 
					    if (inventory.ReceivedStartingGear) {
 | 
				
			||||||
 | 
					        throw new Error(`account has already received starting gear`);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    inventory.ReceivedStartingGear = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const { LongGuns, Pistols, Suits, Melee } = startingGear || {
 | 
					    const { LongGuns, Pistols, Suits, Melee } = startingGear || {
 | 
				
			||||||
        LongGuns: [{ ItemType: "/Lotus/Weapons/Tenno/Rifle/Rifle" }],
 | 
					        LongGuns: [{ ItemType: "/Lotus/Weapons/Tenno/Rifle/Rifle" }],
 | 
				
			||||||
        Pistols: [{ ItemType: "/Lotus/Weapons/Tenno/Pistol/Pistol" }],
 | 
					        Pistols: [{ ItemType: "/Lotus/Weapons/Tenno/Pistol/Pistol" }],
 | 
				
			||||||
@ -197,11 +202,6 @@ export const addStartingGear = async (
 | 
				
			|||||||
        combineInventoryChanges(inventoryChanges, inventoryDelta);
 | 
					        combineInventoryChanges(inventoryChanges, inventoryDelta);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (inventory.ReceivedStartingGear) {
 | 
					 | 
				
			||||||
        logger.warn(`account already had starting gear but asked for it again?!`);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    inventory.ReceivedStartingGear = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return inventoryChanges;
 | 
					    return inventoryChanges;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user