From 81b0c828dc288bce40229bf9f79f9f6e7d411e55 Mon Sep 17 00:00:00 2001 From: ghkkk090 Date: Fri, 26 Aug 2022 14:01:23 +0700 Subject: [PATCH] fix challenger meters difference --- src/modules/cars.ts | 11 ++++++++++- src/modules/ghost.ts | 22 ++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/modules/cars.ts b/src/modules/cars.ts index c0360f9..149e4cc 100644 --- a/src/modules/cars.ts +++ b/src/modules/cars.ts @@ -197,12 +197,21 @@ export default class CarModule extends Module { lastPlayedPlace: true } }) + + let result = 0; + if(challengers.result > 0) + { + result = -Math.abs(challengers.result); + } + else{ + result = Math.abs(challengers.result); + } carsChallengers.push( wm.wm.protobuf.ChallengerCar.create({ car: carTarget!, stamp: challengers.stamp, - result: challengers.result, + result: result, area: challengers.area }) ); diff --git a/src/modules/ghost.ts b/src/modules/ghost.ts index c2ecfbc..2cd5a09 100644 --- a/src/modules/ghost.ts +++ b/src/modules/ghost.ts @@ -126,11 +126,20 @@ export default class GhostModule extends Module { } }) + let result = 0; + if(challengers[i].result > 0) + { + result = -Math.abs(challengers[i].result); + } + else{ + result = Math.abs(challengers[i].result); + } + carsChallenger.push( wm.wm.protobuf.ChallengerCar.create({ car: carTarget!, stamp: challengers[i].stamp, - result: challengers[i].result, + result: result, area: challengers[i].area }) ); @@ -218,11 +227,20 @@ export default class GhostModule extends Module { } }) + let result = 0; + if(challengers[i].result > 0) + { + result = -Math.abs(challengers[i].result); + } + else{ + result = Math.abs(challengers[i].result); + } + carsChallenger.push( wm.wm.protobuf.ChallengerCar.create({ car: carTarget!, stamp: challengers[i].stamp, - result: challengers[i].result, + result: result, area: challengers[i].area }) );