From 1c473e7211f398e057c7e3cdfbdba66f5390e1cb Mon Sep 17 00:00:00 2001 From: ghkkk090 Date: Sun, 4 Sep 2022 19:03:11 +0700 Subject: [PATCH] update ocm tally --- src/modules/ghost.ts | 4 ++-- src/util/ghost/ghost_ocm.ts | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/modules/ghost.ts b/src/modules/ghost.ts index 25b19d5..fda1877 100644 --- a/src/modules/ghost.ts +++ b/src/modules/ghost.ts @@ -339,8 +339,8 @@ export default class GhostModule extends Module { { // Pick random car Id let randomNumber: number = Math.floor(Math.random() * car.length); - if(arr.indexOf(randomNumber) === -1){ - + if(arr.indexOf(randomNumber) === -1) + { // Push current number to array arr.push(randomNumber); diff --git a/src/util/ghost/ghost_ocm.ts b/src/util/ghost/ghost_ocm.ts index c3de04c..dd5bd6d 100644 --- a/src/util/ghost/ghost_ocm.ts +++ b/src/util/ghost/ghost_ocm.ts @@ -13,6 +13,7 @@ export async function ocmTallying(body: wm.protobuf.LoadGhostCompetitionInfoRequ { periodId = periodId - 1; + // Current day is main draw and tallying qualifying period if(periodId === 0) { console.log('Tallying data from Qualifying'); @@ -28,12 +29,14 @@ export async function ocmTallying(body: wm.protobuf.LoadGhostCompetitionInfoRequ result: 'desc', } }); + let arr = []; // gbRecordTally is set if(gbRecordTally) { let top1advantage = null; let currentResult = 0; + for(let i=0; i