Fix battle timeout

This commit is contained in:
Dragon Fire
2020-05-07 17:46:06 -04:00
parent 4f26235490
commit 924ad0bb8d
+1 -1
View File
@@ -36,7 +36,7 @@ module.exports = class BattleCommand extends Command {
return msg.say('Looks like they declined...'); return msg.say('Looks like they declined...');
} }
} }
while (!battle.winner && battle.winner !== 'time') { while (!battle.winner || battle.winner !== 'time') {
const choice = await battle.attacker.chooseAction(msg); const choice = await battle.attacker.chooseAction(msg);
if (choice === 'attack') { if (choice === 'attack') {
const damage = randomRange(battle.defender.guard ? 5 : 20, battle.defender.guard ? 20 : 50); const damage = randomRange(battle.defender.guard ? 5 : 20, battle.defender.guard ? 20 : 50);