diff --git a/src/modules/cars.ts b/src/modules/cars.ts index c508469..9175806 100644 --- a/src/modules/cars.ts +++ b/src/modules/cars.ts @@ -575,6 +575,7 @@ export default class CarModule extends Module { // Get the request body for the update car request let body = wm.wm.protobuf.UpdateCarRequest.decode(req.body); + console.log(body); // Get the ghost result for the car let cars = body?.car; @@ -704,26 +705,38 @@ export default class CarModule extends Module { wingTip: common.sanitizeInput(gtWing.wingTip), material: common.sanitizeInput(gtWing.material), } + + await prisma.carGTWing.update({ + where: { + dbId: body.carId + }, + data: dataGTWing + }) } - else + // Check if this is in getting new custom color screen or not + else if(body.car?.carId !== null && body.car?.carId !== undefined) { - dataGTWing = { - pillar: 0, - pillarMaterial: 0, - mainWing: 0, - mainWingColor: 0, - wingTip: 0, - material: 0, + // GT Wing not set + if(gtWing === undefined || gtWing === null) + { + dataGTWing = { + pillar: 0, + pillarMaterial: 0, + mainWing: 0, + mainWingColor: 0, + wingTip: 0, + material: 0, + } + + await prisma.carGTWing.update({ + where: { + dbId: body.carId + }, + data: dataGTWing + }) } } - await prisma.carGTWing.update({ - where: { - dbId: body.carId - }, - data: dataGTWing - }) - // Response data let msg = { error: wm.wm.protobuf.ErrorCode.ERR_SUCCESS, diff --git a/src/util/games/ghost.ts b/src/util/games/ghost.ts index e6bcc93..cb932f0 100644 --- a/src/util/games/ghost.ts +++ b/src/util/games/ghost.ts @@ -71,13 +71,19 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ // ghostResult is set if (ghostResult) { + let stampSheet: any = undefined; + if(ghostResult.stampSheet!.length > 0) + { + stampSheet = ghostResult.stampSheet; + } + // Ghost update data dataGhost = { rgRegionMapScore: common.sanitizeInput(ghostResult.rgRegionMapScore), rgPlayCount: common.sanitizeInput(ghostResult.rgPlayCount), dressupLevel: common.sanitizeInput(ghostResult.dressupLevel), dressupPoint: common.sanitizeInput(ghostResult.dressupPoint), - stampSheet: common.sanitizeInput(ghostResult.stampSheet), + stampSheet: stampSheet, stampSheetCount: common.sanitizeInputNotZero(ghostResult.stampSheetCount), }