Skip to content

Commit

Permalink
* Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Kholodilin committed Nov 7, 2016
1 parent bc8f92b commit 452bc2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Chrl/AppBundle/Service/GameService.php
Expand Up @@ -142,7 +142,7 @@ public function checkAnswer($message)
$game->incorrectTries++;
$hint = $game->hint;

if (mb_substr_count($hint,'*','UTF-8') < mb_strlen($hint,'UTF-8')/2) {
if (mb_substr_count($hint,'*','UTF-8') >= mb_strlen($hint,'UTF-8')/2) {
//tell hint

$tPos = rand(0,mb_strlen($question->a1,'UTF-8'));
Expand All @@ -160,11 +160,12 @@ public function checkAnswer($message)
'<b>Hint</b>: '.$hint,
'html'
);

} else {
$this->botApi->sendMessage(
$game->chatId,
'Noone answered, correct answer was: *'.$question->a1.'*',
'html'
'markdown'
);
$this->em->persist($game);
$this->em->flush();
Expand Down

0 comments on commit 452bc2d

Please sign in to comment.