mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
Fix
This commit is contained in:
@@ -155,7 +155,7 @@ module.exports = class CarRaceCommand extends Command {
|
|||||||
let oppoCarSpaces = 0;
|
let oppoCarSpaces = 0;
|
||||||
let lastRoundWinner;
|
let lastRoundWinner;
|
||||||
let lastTurnTimeout = false;
|
let lastTurnTimeout = false;
|
||||||
while (userCarSpaces < 5 && oppoCarSpaces < 5) {
|
while (userCarSpaces < 6 && oppoCarSpaces < 6) {
|
||||||
const board = this.generateBoard(bg, userCar, oppoCar, userCarSpaces, oppoCarSpaces);
|
const board = this.generateBoard(bg, userCar, oppoCar, userCarSpaces, oppoCarSpaces);
|
||||||
let text;
|
let text;
|
||||||
if (lastRoundWinner) {
|
if (lastRoundWinner) {
|
||||||
@@ -177,8 +177,8 @@ module.exports = class CarRaceCommand extends Command {
|
|||||||
time: randomRange(1000, 30000)
|
time: randomRange(1000, 30000)
|
||||||
});
|
});
|
||||||
if (earlyEnd.size) {
|
if (earlyEnd.size) {
|
||||||
if (earlyEnd.first().author.id === msg.author.id) oppoCarSpaces = 5;
|
if (earlyEnd.first().author.id === msg.author.id) oppoCarSpaces = 6;
|
||||||
else if (earlyEnd.first().author.id === opponent.id) userCarSpaces = 5;
|
else if (earlyEnd.first().author.id === opponent.id) userCarSpaces = 6;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const word = words[Math.floor(Math.random() * words.length)];
|
const word = words[Math.floor(Math.random() * words.length)];
|
||||||
@@ -204,8 +204,8 @@ module.exports = class CarRaceCommand extends Command {
|
|||||||
}
|
}
|
||||||
const win = winner.first();
|
const win = winner.first();
|
||||||
if (win.content.toLowerCase() === 'end') {
|
if (win.content.toLowerCase() === 'end') {
|
||||||
if (win.author.id === msg.author.id) oppoCarSpaces = 5;
|
if (win.author.id === msg.author.id) oppoCarSpaces = 6;
|
||||||
else if (win.author.id === opponent.id) userCarSpaces = 5;
|
else if (win.author.id === opponent.id) userCarSpaces = 6;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (win.author.id === msg.author.id) userCarSpaces += 1;
|
if (win.author.id === msg.author.id) userCarSpaces += 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user