diff --git a/src/modules/cars/functions.ts b/src/modules/cars/functions.ts index f1a6bb3..5a0a440 100644 --- a/src/modules/cars/functions.ts +++ b/src/modules/cars/functions.ts @@ -147,7 +147,7 @@ export async function getOpponentsTarget(carId: number, registeredargetAvailable } // Randomize it 5 times - while(randomArray.length < 5) + while(randomArray.length < maxNumber) { // Pick random car Id random = Math.floor(Math.random() * opponentTargetCount + 0.9);