Skip to content

Commit

Permalink
game ending fix
Browse files Browse the repository at this point in the history
  • Loading branch information
peaashmeter committed Aug 17, 2022
1 parent 44ddf51 commit 21be2ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 7 additions & 4 deletions lib/bot/bot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ void runBot(String token) {

//через 2 минуты регистрация отменяется
Future.delayed(const Duration(minutes: 2), () {
state.turnManager.isPlaying = false;
state.resetGame();
e.message.channel.sendMessage(
MessageBuilder.content('Регистрация на игру отменена!'));
if (state.isStartingGame) {
state.isStartingGame = false;
state.turnManager.isPlaying = false;
state.resetGame();
e.message.channel.sendMessage(
MessageBuilder.content('Регистрация на игру отменена!'));
}
});
} else if (e.message.content == "!start") {
if (e.message.author.id.id != gameInitiatorId) {
Expand Down
5 changes: 2 additions & 3 deletions lib/patchnote.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const patchnote = '''SquareBattle v.1.1.4
(Хост) размер скриншота в дискорде больше не зависит от размера окна игры.
Теперь регистрация на игру автоматически отменяется через 2 минуты.
const patchnote = '''SquareBattle v.1.1.5
Исправлен баг, из-за которого игра автоматически завершалась спустя 2 минуты
''';

0 comments on commit 21be2ee

Please sign in to comment.