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

player index of '0' != false #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

inheritancejon
Copy link

When player at index 0

players[0];

leaves, it should remove them from the players array. Without this change, javascript returns '0' from the playerByID function, and it is interpreted as 'false'. The player id is then left in the array, leaving one player always active.

Also, I'm so new it hurts. I was just working through your example from a few years ago, found this error, and figure its time to try baby's first pull request. Thanks if you approve.

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

Successfully merging this pull request may close these issues.

1 participant