XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

fix: motorcycle in backroom is broken (#736)

8d7f69ce
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +12 -0
Modified src/controllers/api/setBootLocationController.ts +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 };