From 208fc4d9a7cc916c0319ca858531c48df2d841a1 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 21 Apr 2020 18:51:31 -0400 Subject: [PATCH] Fix --- commands/games-sp/horse-race.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/games-sp/horse-race.js b/commands/games-sp/horse-race.js index cdfe1785..67414a3a 100644 --- a/commands/games-sp/horse-race.js +++ b/commands/games-sp/horse-race.js @@ -6,6 +6,7 @@ const { shuffle } = require('../../util/Util'); const { drawImageWithTint, randomRange } = require('../../util/Canvas'); const horses = require('../../assets/json/horse-race'); registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Paladins-nl8P.otf'), { family: 'Paladins' }); +const colors = ['gold', 'silver', '#cd7f32']; module.exports = class HorseRaceCommand extends Command { constructor(client) { @@ -93,7 +94,7 @@ module.exports = class HorseRaceCommand extends Command { for (let i = 0; i < horses.length; i++) { const horse = horses[i]; const result = results.find(result => horse.name === result.name).time; - drawImageWithTint(ctx, horseImg, horse.color, 37 * i, 114, 49, 49); + if (colors[i]) drawImageWithTint(ctx, horseImg, colors[i], 37 * i, 114, 49, 49); ctx.fillText(this.formatTime(result), 138 * i, 755); ctx.fillText(horse.name, 138 * 1, 251); }