KevinVillela / lovecraft

A lovecraftian nightmare!
2 stars 2 forks source link

Mirage as 1st pick in round re-shuffles hand #14

Closed crmirand closed 4 years ago

crmirand commented 4 years ago

While playing a game in the room 6otr we encountered a bug where our hands were reshuffled after 'mirage' was the first card picked in round 2. Everyone's hands were re-shuffled and the round counter advanced to round 3

crmirand commented 4 years ago

Believe that the issue occurs here when checking whether the visible cards is evenly divisible by the number of players. In this instance, we are at the start of the round so there are no additional cards visible. After 'mirage' is played, the mirage card replaces a card which was previously visible, so the number of visible cards ends up being evenly divisible by the number of players. maybe something like below would fix the bug here? if (game.visibleCards.length !== game.playerList.length * game.round) { return false; }

KevinVillela commented 4 years ago

Thanks for filing! Will take a look now...

KevinVillela commented 4 years ago

Thanks for filing, should be fixed in prod now :)