From d7e6a54811446a49d27f4775898066af0173707f Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 8 Aug 2020 13:33:13 -0400 Subject: [PATCH] Fix infinite loop in RandomWord --- src/game/language.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/language.ts b/src/game/language.ts index d39805a..a56ac90 100644 --- a/src/game/language.ts +++ b/src/game/language.ts @@ -226,7 +226,7 @@ export class RandomWord extends Word { do { choice = Math.floor(Math.random() * this.choices.length) - } while (choice === this.history.last) + } while (choice === this.history.last && this.choices.length > 1) this.history.last = choice return this.choices[choice].configure(this.opt).toString()