1
0
mirror of synced 2024-12-05 03:27:57 +01:00

fix crown ghost

This commit is contained in:
ghkkk090 2022-08-19 13:09:34 +07:00
parent a11b6ea3e2
commit 388a5f9837
2 changed files with 10 additions and 10 deletions

View File

@ -9,7 +9,6 @@ export async function saveGhostHistory(body: wm.protobuf.SaveGameResultRequest)
{
console.log('Saving Ghost Battle History');
let updateNewTrail: boolean = true;
let saveExGhostHistory: any = {};
if (body.car?.carId !== null && body.car?.carId !== undefined) {
@ -133,9 +132,6 @@ export async function saveGhostHistory(body: wm.protobuf.SaveGameResultRequest)
await prisma.ghostBattleRecord.create({
data: saveExGhostHistory
});
// Return the value to 'BASE_PATH/src/util/games/ghost.ts'
return { updateNewTrail }
}

View File

@ -180,7 +180,7 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
// Crown Ghost Battle Mode
case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SELECT_CROWN_MATCH:
{
// If not losing to the crown ghost battle
// Not losing to the crown ghost battle
if (body.rgResult?.acquireCrown !== false && body.rgResult?.acquireCrown)
{
console.log('Crown Ghost Mode Found');
@ -315,12 +315,16 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
});
}
}
ghost_historys = await ghost_history.saveGhostHistory(body);
// Update the updateNewTrail value
updateNewTrail = ghost_historys.updateNewTrail;
updateNewTrail = true;
}
// Losing to the crown ghost battle
else
{
updateNewTrail = false;
}
await ghost_history.saveGhostHistory(body);
break;
}