1
0
mirror of synced 2025-02-01 12:18:01 +01:00

fix hof ocm

This commit is contained in:
Shiroi Kitsu 2023-01-03 14:33:48 +07:00
parent 7952897e61
commit cd1d3db553
2 changed files with 6 additions and 44 deletions

View File

@ -716,46 +716,12 @@ export default class GhostModule extends Module {
// Get the trail data
let ghost_trails = await ghost_trail.getOCMGhostTrail(pCarId, pTrailId);
// Qualifiers or Main Draw OCM
if(ghost_trails.ghostFound === true)
{
pArea = ghost_trails.areaVal;
rampVal = ghost_trails.rampVal;
pathVal = ghost_trails.pathVal;
playedAt = ghost_trails.playedAt;
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
else
{

View File

@ -98,7 +98,6 @@ export async function getOCMGhostTrail(carId: number, trailId: number)
let pathVal = 0;
let playedAt = 0;
let ghostTrail;
let ghostFound: boolean = false;
// Trails data for certain area is available
if(ghost_trails)
@ -119,9 +118,6 @@ export async function getOCMGhostTrail(carId: number, trailId: number)
// Set to OCM trail data
ghostTrail = ghost_trails!.trail;
// Set OCM ghost trail found
ghostFound = true;
}
// Trails data for certain area is not available
else
@ -141,7 +137,7 @@ export async function getOCMGhostTrail(carId: number, trailId: number)
ghostTrail = new Uint8Array([1, 2, 3, 4]);
}
return { areaVal, rampVal, pathVal, playedAt, ghostTrail, ghostFound }
return { areaVal, rampVal, pathVal, playedAt, ghostTrail }
}