fix: tutorial being skipped with skipTutorial disabled #613

Merged
Sainan merged 4 commits from tutorial into main 2024-12-29 12:11:10 -08:00
Showing only changes of commit 8c51e443af - Show all commits

View File

@ -49,17 +49,19 @@ export const createInventory = async (
defaultItemReferences: { loadOutPresetId: Types.ObjectId; ship: Types.ObjectId } defaultItemReferences: { loadOutPresetId: Types.ObjectId; ship: Types.ObjectId }
) => { ) => {
try { try {
const inventory = new Inventory({ const inventory = config.skipTutorial
...new_inventory, ? new Inventory({
accountOwnerId: accountOwnerId, accountOwnerId: accountOwnerId,
LoadOutPresets: defaultItemReferences.loadOutPresetId, LoadOutPresets: defaultItemReferences.loadOutPresetId,
Ships: [defaultItemReferences.ship] Ships: [defaultItemReferences.ship],
}); ...new_inventory
if (config.skipTutorial) { })
inventory.PlayedParkourTutorial = true; : new Inventory({
inventory.ReceivedStartingGear = true; accountOwnerId: accountOwnerId,
} LoadOutPresets: defaultItemReferences.loadOutPresetId,
Ships: [defaultItemReferences.ship],
TrainingDate: 0
});
await inventory.save(); await inventory.save();
} catch (error) { } catch (error) {
if (error instanceof Error) { if (error instanceof Error) {