1
0
mirror of https://github.com/shiroikitsu8/Bayshore_6r_legacy.git synced 2024-11-28 09:20:54 +01:00

fix ocm ghost registered from terminal

This commit is contained in:
ghkkk090 2022-08-30 18:29:15 +07:00
parent 3b3e5be2bd
commit 41c72d24b8
2 changed files with 31 additions and 21 deletions

View File

@ -103,6 +103,8 @@ export default class CarModule extends Module {
if(checkRegisteredGhost)
{
console.log('OCM Ghost Registered From Terminal');
let getNo1OCM = await prisma.oCMTally.findFirst({
where:{
competitionId: ocmEventDate.competitionId,
@ -115,12 +117,10 @@ export default class CarModule extends Module {
if(getNo1OCM)
{
let carId = getNo1OCM.carId
// Get Car Data
let cars = await prisma.car.findFirst({
where:{
carId: carId
carId: getNo1OCM.carId
},
include:{
gtWing: true,
@ -131,25 +131,33 @@ export default class CarModule extends Module {
// Get Ghost Trail
let ghostTrailNo1 = await prisma.oCMTop1GhostTrail.findFirst({
where:{
carId: carId,
competitionId: ocmEventDate.competitionId,
periodId: 999999999
carId: getNo1OCM.carId,
competitionId: ocmEventDate.competitionId
},
orderBy:{
dbId: 'asc'
}
});
trailIdNo1 = ghostTrailNo1!.dbId;
if(ghostTrailNo1)
{
console.log('Getting registered ghost trail');
ghostCarsNo1 = wm.wm.protobuf.GhostCar.create({
car: {
...cars!,
},
area: ghostTrailNo1!.area,
ramp: ghostTrailNo1!.ramp,
path: ghostTrailNo1!.path,
nonhuman: false,
type: wm.wm.protobuf.GhostType.GHOST_NORMAL,
trailId: trailIdNo1
});
trailIdNo1 = ghostTrailNo1.dbId;
ghostCarsNo1 = wm.wm.protobuf.GhostCar.create({
car: {
...cars!,
},
area: ghostTrailNo1.area,
ramp: ghostTrailNo1.ramp,
path: ghostTrailNo1.path,
nonhuman: false,
type: wm.wm.protobuf.GhostType.GHOST_NORMAL,
trailId: trailIdNo1
});
}
}
}
}

View File

@ -76,7 +76,8 @@ export default class GhostModule extends Module {
// Get all of the friend cars for the carId provided
let stampTargets = await prisma.carStampTarget.findMany({
where: {
stampTargetCarId: body.carId
stampTargetCarId: body.carId,
locked: false
}
});
@ -177,7 +178,8 @@ export default class GhostModule extends Module {
// Get all of the friend cars for the carId provided
let stampTargets = await prisma.carStampTarget.findMany({
where: {
carId: body.carId
stampTargetCarId: body.carId,
locked: false
}
});
@ -187,7 +189,7 @@ export default class GhostModule extends Module {
{
let carTarget = await prisma.car.findFirst({
where:{
carId: stampTargets[i].stampTargetCarId
carId: stampTargets[i].carId
},
include:{
gtWing: true,