From bda7cea90e8054469f11844fae1763aa9c2fde33 Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 6 Jan 2025 03:37:41 +0100 Subject: [PATCH] fix: motorcycle in backroom is broken --- src/controllers/api/setBootLocationController.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/controllers/api/setBootLocationController.ts b/src/controllers/api/setBootLocationController.ts index 599044a0..4b1b3bc5 100644 --- a/src/controllers/api/setBootLocationController.ts +++ b/src/controllers/api/setBootLocationController.ts @@ -2,11 +2,23 @@ import { RequestHandler } from "express"; import { getAccountIdForRequest } from "@/src/services/loginService"; import { getPersonalRooms } from "@/src/services/personalRoomsService"; import { TBootLocation } from "@/src/types/shipTypes"; +import { getInventory } from "@/src/services/inventoryService"; export const setBootLocationController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); const personalRooms = await getPersonalRooms(accountId); personalRooms.Ship.BootLocation = req.query.bootLocation as string as TBootLocation; await personalRooms.save(); + + if (personalRooms.Ship.BootLocation == "SHOP") { + // Temp fix so the motorcycle in the backroom doesn't appear broken. + // This code may be removed when quests are fully implemented. + const inventory = await getInventory(accountId); + if (inventory.Motorcycles.length == 0) { + inventory.Motorcycles.push({ ItemType: "/Lotus/Types/Vehicles/Motorcycle/MotorcyclePowerSuit" }); + } + await inventory.save(); + } + res.end(); };