check P & H not more than 34
This commit is contained in:
parent
24382998c3
commit
5c345188f2
@ -149,6 +149,16 @@ export default class GameModule extends Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check P & H must not more than 34 (fully tuned value)
|
||||||
|
let tunePower = 0;
|
||||||
|
let tuneHandling = 0;
|
||||||
|
let totalTune = body.car!.tunePower + body.car!.tuneHandling;
|
||||||
|
if(totalTune <= 34)
|
||||||
|
{
|
||||||
|
tunePower = body.car!.tunePower;
|
||||||
|
tuneHandling = body.car!.tuneHandling;
|
||||||
|
}
|
||||||
|
|
||||||
// Update car
|
// Update car
|
||||||
await prisma.car.update({
|
await prisma.car.update({
|
||||||
where: {
|
where: {
|
||||||
@ -161,8 +171,8 @@ export default class GameModule extends Module {
|
|||||||
playCount: body.playCount,
|
playCount: body.playCount,
|
||||||
level: body.car!.level!,
|
level: body.car!.level!,
|
||||||
title: body.car!.title!,
|
title: body.car!.title!,
|
||||||
tunePower: body.car!.tunePower!,
|
tunePower: tunePower,
|
||||||
tuneHandling: body.car!.tuneHandling!,
|
tuneHandling: tuneHandling,
|
||||||
windowSticker: body.car!.windowSticker!,
|
windowSticker: body.car!.windowSticker!,
|
||||||
lastPlayedAt: timestamps,
|
lastPlayedAt: timestamps,
|
||||||
regionId: body.car!.regionId!,
|
regionId: body.car!.regionId!,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user