diff --git a/src/Controller/GameFlowController.php b/src/Controller/GameFlowController.php index 9e173d0..ba07f54 100644 --- a/src/Controller/GameFlowController.php +++ b/src/Controller/GameFlowController.php @@ -149,6 +149,7 @@ class GameFlowController { $currentPlace = $this->placeRepository->getByRoundInChallenge($challenge, $currentRound); + // if the last round was played ($currentPlace == null) or history is explicitly requested (for initializing) if (!isset($currentPlace) || $withHistory) { $withRelations = [User::class, PlaceInChallenge::class, Place::class]; @@ -239,7 +240,7 @@ class GameFlowController $response = $this->prepareChallengeResponse($userId, $challenge, $currentRound, true); - if ($challenge->getTimeLimitType() === 'game' && $userInChallenge->getCurrentRound() > 0) { + if ($challenge->getTimeLimitType() === 'game' && $challenge->getTimeLimit() !== null && $userInChallenge->getCurrentRound() > 0) { $timeLimit = max(10, $userInChallenge->getTimeLeft()); $response['restrictions']['timeLimit'] = $timeLimit * 1000; }