fix: motorcycle in backroom is broken
This commit is contained in:
		
							parent
							
								
									82621ebe0f
								
							
						
					
					
						commit
						bda7cea90e
					
				@ -2,11 +2,23 @@ import { RequestHandler } from "express";
 | 
				
			|||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
					import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
				
			||||||
import { getPersonalRooms } from "@/src/services/personalRoomsService";
 | 
					import { getPersonalRooms } from "@/src/services/personalRoomsService";
 | 
				
			||||||
import { TBootLocation } from "@/src/types/shipTypes";
 | 
					import { TBootLocation } from "@/src/types/shipTypes";
 | 
				
			||||||
 | 
					import { getInventory } from "@/src/services/inventoryService";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const setBootLocationController: RequestHandler = async (req, res) => {
 | 
					export const setBootLocationController: RequestHandler = async (req, res) => {
 | 
				
			||||||
    const accountId = await getAccountIdForRequest(req);
 | 
					    const accountId = await getAccountIdForRequest(req);
 | 
				
			||||||
    const personalRooms = await getPersonalRooms(accountId);
 | 
					    const personalRooms = await getPersonalRooms(accountId);
 | 
				
			||||||
    personalRooms.Ship.BootLocation = req.query.bootLocation as string as TBootLocation;
 | 
					    personalRooms.Ship.BootLocation = req.query.bootLocation as string as TBootLocation;
 | 
				
			||||||
    await personalRooms.save();
 | 
					    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();
 | 
					    res.end();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user