You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that after the game ends, the game remembers the position of the player that won (e.g. the fourth player). However, if a player leaves, changing the order of players, the name in the banner message will change to the player who is now in that position, regardless of who actually won.
The text was updated successfully, but these errors were encountered:
I noticed the same issue today. Looking through your code (which is incredibly clear and well-documented btw), I think one could just add an if statement on line 208 of game.js that checks if the winnerid is set when a player is leaving in the state WAITING_FOR_PLAYERS.
So if the player who is leaving is the winner, the winner gets set to null (but their win will still be recorded in the game history), or if the leaving player's index is lower than the winner, the winner index is decremented.
I understand if you'd rather add a new state that differentiates between WAITING_FOR_PLAYERS and WAITING_TO_PLAY_AGAIN which would obviously be a larger change.
It appears that after the game ends, the game remembers the position of the player that won (e.g. the fourth player). However, if a player leaves, changing the order of players, the name in the banner message will change to the player who is now in that position, regardless of who actually won.
The text was updated successfully, but these errors were encountered: