Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

game.uno() throws error for non current players #26

Open
nikhilbaby opened this issue Oct 24, 2019 · 0 comments
Open

game.uno() throws error for non current players #26

nikhilbaby opened this issue Oct 24, 2019 · 0 comments

Comments

@nikhilbaby
Copy link

I tried the following code:

const {
  Card, Game,
} = require('uno-engine-updated');

const game = new Game(['1', '2', '3']);

The current player is 3 and when I try to run:

game.uno('2')

I get an error like this:

TypeError: Cannot read property 'length' of undefined

The error is from game.js line 217

        if (yellingPlayer.hand.length <= 2 && !this.yellers[yellingPlayer.name]) {
            this.yellers[yellingPlayer.name] = true;
            return [];
        }

Please let me know what is the issue here. Is it something expected from the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant