fix hof ocm
This commit is contained in:
parent
7952897e61
commit
cd1d3db553
@ -716,46 +716,12 @@ export default class GhostModule extends Module {
|
|||||||
// Get the trail data
|
// Get the trail data
|
||||||
let ghost_trails = await ghost_trail.getOCMGhostTrail(pCarId, pTrailId);
|
let ghost_trails = await ghost_trail.getOCMGhostTrail(pCarId, pTrailId);
|
||||||
|
|
||||||
// Qualifiers or Main Draw OCM
|
|
||||||
if(ghost_trails.ghostFound === true)
|
|
||||||
{
|
|
||||||
pArea = ghost_trails.areaVal;
|
pArea = ghost_trails.areaVal;
|
||||||
rampVal = ghost_trails.rampVal;
|
rampVal = ghost_trails.rampVal;
|
||||||
pathVal = ghost_trails.pathVal;
|
pathVal = ghost_trails.pathVal;
|
||||||
playedAt = ghost_trails.playedAt;
|
playedAt = ghost_trails.playedAt;
|
||||||
ghostTrail = ghost_trails.ghostTrail;
|
ghostTrail = ghost_trails.ghostTrail;
|
||||||
}
|
}
|
||||||
// HoF OCM
|
|
||||||
else
|
|
||||||
{
|
|
||||||
console.log("Getting HoF Ghost Trail")
|
|
||||||
|
|
||||||
let ghost_trail = await prisma.oCMTop1GhostTrail.findFirst({
|
|
||||||
where:{
|
|
||||||
dbId: pTrailId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if(ghost_trail)
|
|
||||||
{
|
|
||||||
pArea = ghost_trail.area;
|
|
||||||
rampVal = ghost_trail.ramp;
|
|
||||||
pathVal = ghost_trail.path;
|
|
||||||
playedAt = ghost_trail.playedAt;
|
|
||||||
ghostTrail = ghost_trail.trail;
|
|
||||||
}
|
|
||||||
// HoF Not Found
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pArea = ghost_trails.areaVal;
|
|
||||||
rampVal = ghost_trails.rampVal;
|
|
||||||
pathVal = ghost_trails.pathVal;
|
|
||||||
playedAt = ghost_trails.playedAt;
|
|
||||||
ghostTrail = ghost_trails.ghostTrail;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Query parameter from Crown Ghost Battle available
|
// Query parameter from Crown Ghost Battle available
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -98,7 +98,6 @@ export async function getOCMGhostTrail(carId: number, trailId: number)
|
|||||||
let pathVal = 0;
|
let pathVal = 0;
|
||||||
let playedAt = 0;
|
let playedAt = 0;
|
||||||
let ghostTrail;
|
let ghostTrail;
|
||||||
let ghostFound: boolean = false;
|
|
||||||
|
|
||||||
// Trails data for certain area is available
|
// Trails data for certain area is available
|
||||||
if(ghost_trails)
|
if(ghost_trails)
|
||||||
@ -119,9 +118,6 @@ export async function getOCMGhostTrail(carId: number, trailId: number)
|
|||||||
|
|
||||||
// Set to OCM trail data
|
// Set to OCM trail data
|
||||||
ghostTrail = ghost_trails!.trail;
|
ghostTrail = ghost_trails!.trail;
|
||||||
|
|
||||||
// Set OCM ghost trail found
|
|
||||||
ghostFound = true;
|
|
||||||
}
|
}
|
||||||
// Trails data for certain area is not available
|
// Trails data for certain area is not available
|
||||||
else
|
else
|
||||||
@ -141,7 +137,7 @@ export async function getOCMGhostTrail(carId: number, trailId: number)
|
|||||||
ghostTrail = new Uint8Array([1, 2, 3, 4]);
|
ghostTrail = new Uint8Array([1, 2, 3, 4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return { areaVal, rampVal, pathVal, playedAt, ghostTrail, ghostFound }
|
return { areaVal, rampVal, pathVal, playedAt, ghostTrail }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user