1
0
mirror of synced 2025-01-22 11:23:40 +01:00

check P & H not more than 34

This commit is contained in:
Shiroi Kitsu 2023-01-20 14:48:11 +07:00
parent 24382998c3
commit 5c345188f2

View File

@ -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
await prisma.car.update({
where: {
@ -161,8 +171,8 @@ export default class GameModule extends Module {
playCount: body.playCount,
level: body.car!.level!,
title: body.car!.title!,
tunePower: body.car!.tunePower!,
tuneHandling: body.car!.tuneHandling!,
tunePower: tunePower,
tuneHandling: tuneHandling,
windowSticker: body.car!.windowSticker!,
lastPlayedAt: timestamps,
regionId: body.car!.regionId!,