I misunderstood the instructions on how to use the custom order functions and returned the playerID (a string) instead of the playOrder index (a number) from a phase's order.first() function.
const phase = {
moves: { ... },
turn: {
order: {
first: (G) => G.firstPlayer
}
}
}
This also worked for the first move, and the correct player was set. This made it hard to detect where the upcoming unexpected behavior originated: When ending the first turn (and also phase), the second player was not the next player in playOrder as expected, but (in a 4 player game) was always either player "1" if the first player was player "0" or "2" or player "3" if the first player was player "1" or "3".
Despite the question why the app behaved like this, I would suggest making misuse of the first() function more clear or allow returning a string playerID with expected behavior.
I misunderstood the instructions on how to use the custom order functions and returned the playerID (a string) instead of the playOrder index (a number) from a phase's
order.first()function.This also worked for the first move, and the correct player was set. This made it hard to detect where the upcoming unexpected behavior originated: When ending the first turn (and also phase), the second player was not the next player in playOrder as expected, but (in a 4 player game) was always either player "1" if the first player was player "0" or "2" or player "3" if the first player was player "1" or "3".
Despite the question why the app behaved like this, I would suggest making misuse of the
first()function more clear or allow returning a stringplayerIDwith expected behavior.