-
Notifications
You must be signed in to change notification settings - Fork 716
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
Strange behaviour for setStage and setActivePlayers for Stage.NULL #848
Comments
function onMove(G, ctx) {
ctx.events.setActivePlayers({
value: {
...ctx.activePlayers,
[ctx.playerID]: Stage.NULL,
}
});
} That isn’t really risky, but More importantly, Lines 559 to 567 in 5d34610
Would you like to fix that and add a test for |
Sure, I'll do that. I've also tried that with a unit test and found that bug. |
…loses #848) (#849) * Fixing setStage to make players set on Stage.NULL active. * Update src/core/turn-order.test.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update src/core/turn-order.test.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> Co-authored-by: Evandro Abu Kamel <evandro.costa@maxmilhas.com.br> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
…loses boardgameio#848) (boardgameio#849) * Fixing setStage to make players set on Stage.NULL active. * Update src/core/turn-order.test.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update src/core/turn-order.test.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> Co-authored-by: Evandro Abu Kamel <evandro.costa@maxmilhas.com.br> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
…loses boardgameio#848) (boardgameio#849) * Fixing setStage to make players set on Stage.NULL active. * Update src/core/turn-order.test.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update src/core/turn-order.test.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> Co-authored-by: Evandro Abu Kamel <evandro.costa@maxmilhas.com.br> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
…loses boardgameio#848) (boardgameio#849) * Fixing setStage to make players set on Stage.NULL active. * Update src/core/turn-order.test.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update src/core/turn-order.test.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> Co-authored-by: Evandro Abu Kamel <evandro.costa@maxmilhas.com.br> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Hey guys, what's up? I have a question about using the Stage.NULL. In the docs it's said that players can become active but in no stage if we set them to Stage.NULL using
setActivePlayers
.What I'm trying to achieve is to make all players to use a specific move from no stage but when they make some moves from specific stages they must exit that stage but still become active. So, I'm trying to keep all other players in the same state they are when players calls a move that should put themselves to Stage.NULL. Now, everybody receive a "player not active" error. So I try a few things:
1. Using
setStage(Stage.NULL)
at the end of a move: by doing this, the player was removed fromactivePlayers
property, thus becoming inactive.2. Using
setActivePlayers([ctx.playerID])
at the end of a move: by doing this, only that player becomes active in Stage.NULL and all other players are removed fromactivePlayers
property.So, am I doing something wrong or is there a bug in one of those functions?
What you suggest me to do? I was thinking of merge the current
ctx.activePlayers
withsetActivePlayers
parameter, but I think this is very risky. Don't know.Thanks.
The text was updated successfully, but these errors were encountered: