From dddeca986706933d7c4c1deccd19f6cf897affd3 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Mon, 16 Sep 2019 12:08:02 +0200 Subject: [PATCH] Add comment about setTimeout hack --- src/mlpccg/draft/bot.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mlpccg/draft/bot.ts b/src/mlpccg/draft/bot.ts index 1d443ea..081b177 100644 --- a/src/mlpccg/draft/bot.ts +++ b/src/mlpccg/draft/bot.ts @@ -5,6 +5,7 @@ export class DraftBot { assign(player: SessionPlayer) { player.on("available-picks", cards => { const pick = this.pick(cards); + // setTimeout hack to avoid handlers being called before the rest of the code setTimeout(() => player.pick(pick.ID), 0); }); }