Skip to content

Commit

Permalink
Add config update on phase change Fixes #211 (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-toller authored and nicolodavis committed Jun 3, 2018
1 parent 8db26d2 commit 40cd4b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ export function FlowWithPhases({
}

function processMove(state, action, dispatch) {
const conf = phaseMap[state.ctx.phase];
let conf = phaseMap[state.ctx.phase];

const currentPlayerMoves = state.ctx.currentPlayerMoves + 1;
state = {
Expand All @@ -545,6 +545,8 @@ export function FlowWithPhases({
state,
gameEvent('endPhase', [endPhase], action.playerID)
);
// Update to the new phase configuration
conf = phaseMap[state.ctx.phase];
}

// End the turn automatically if endTurnIf is true or if endGameIf returns.
Expand Down

0 comments on commit 40cd4b8

Please sign in to comment.