返回提交历史
Modified
src/controllers/api/setBootLocationController.ts
+12
-0
XFEstudio/SpaceNinjaServer
fix: motorcycle in backroom is broken (#736)
8d7f69ce
代码差异
1 个文件
+12
-0
@@ -2,11 +2,23 @@ import { RequestHandler } from "express";
2
2
import { getAccountIdForRequest } from "@/src/services/loginService";
3
3
import { getPersonalRooms } from "@/src/services/personalRoomsService";
4
4
import { TBootLocation } from "@/src/types/shipTypes";
5
import { getInventory } from "@/src/services/inventoryService";
5
6
6
7
export const setBootLocationController: RequestHandler = async (req, res) => {
7
8
const accountId = await getAccountIdForRequest(req);
8
9
const personalRooms = await getPersonalRooms(accountId);
9
10
personalRooms.Ship.BootLocation = req.query.bootLocation as string as TBootLocation;
10
11
await personalRooms.save();
12
13
if (personalRooms.Ship.BootLocation == "SHOP") {
14
// Temp fix so the motorcycle in the backroom doesn't appear broken.
15
// This code may be removed when quests are fully implemented.
16
const inventory = await getInventory(accountId);
17
if (inventory.Motorcycles.length == 0) {
18
inventory.Motorcycles.push({ ItemType: "/Lotus/Types/Vehicles/Motorcycle/MotorcyclePowerSuit" });
19
await inventory.save();
20
}
21
}
22
11
23
res.end();
12
24
};