diff --git a/modules/VelonimoCard.php b/modules/VelonimoCard.php index f0b8efe..1885207 100644 --- a/modules/VelonimoCard.php +++ b/modules/VelonimoCard.php @@ -1,5 +1,7 @@ getCurrentLoser($players)) { $this->gamestate->changeActivePlayer($currentLoser->getId()); + } else { + self::activeNextPlayer(); } $this->gamestate->nextState('firstPlayerTurn'); @@ -604,9 +607,9 @@ function upgradeTableDb($from_version) private function fromBgaCardsToVelonimoCards(array $bgaCards): array { return array_map( fn (array $card) => new VelonimoCard( - $card['card_id'], - $card['card_type'], - $card['card_type_arg'] + (int) $card['id'], + (int) $card['type'], + (int) $card['type_arg'] ), $bgaCards ); @@ -656,11 +659,11 @@ private function getPlayersFromDatabase(): array { return array_map( fn (array $player) => new VelonimoPlayer( - $player['player_id'], + (int) $player['player_id'], $player['player_name'], - $player['player_score'], + (int) $player['player_score'], VelonimoPlayer::deserializeRoundsRanking($player['rounds_ranking']), - $player['is_wearing_jersey'], + ((int) $player['is_wearing_jersey']) === 1, ), $players );