ghost search by region
you will stuck at connecting screen if there is no car for that region
This commit is contained in:
parent
c5be8dd997
commit
810bcebab2
@ -235,16 +235,34 @@ export default class GhostModule extends Module {
|
||||
// Get the request body for the search cars by level request
|
||||
let body = wm.wm.protobuf.SearchCarsByLevelRequest.decode(req.body);
|
||||
|
||||
// Find ghost car by selected level
|
||||
let car = await prisma.car.findMany({
|
||||
where: {
|
||||
ghostLevel: body.ghostLevel
|
||||
},
|
||||
include:{
|
||||
gtWing: true,
|
||||
lastPlayedPlace: true,
|
||||
}
|
||||
});
|
||||
let car;
|
||||
if(body.regionId !== null && body.regionId !== undefined && body.regionId !== 0)
|
||||
{
|
||||
// Find ghost car by selected level and region ID
|
||||
car = await prisma.car.findMany({
|
||||
where: {
|
||||
ghostLevel: body.ghostLevel,
|
||||
regionId: body.regionId
|
||||
},
|
||||
include:{
|
||||
gtWing: true,
|
||||
lastPlayedPlace: true,
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// Find ghost car by selected level
|
||||
car = await prisma.car.findMany({
|
||||
where: {
|
||||
ghostLevel: body.ghostLevel,
|
||||
},
|
||||
include:{
|
||||
gtWing: true,
|
||||
lastPlayedPlace: true,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Randomizing the starting ramp and path based on selected area
|
||||
let rampVal = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user