Skip to content

Commit

Permalink
increment turn before calling turn.onBegin
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolodavis committed Nov 28, 2019
1 parent e20aca4 commit a2c64f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ export function Flow({ moves, phases, endIf, turn, events, plugins }) {
ctx = InitTurnOrderState(G, ctx, conf.turn);
}

G = conf.turn.onBegin(G, ctx);

const turn = ctx.turn + 1;
ctx = { ...ctx, turn, numMoves: 0, _prevActivePlayers: [] };

G = conf.turn.onBegin(G, ctx);

const plainCtx = ContextEnhancer.detachAllFromContext(ctx);
const _undo = [{ G, ctx: plainCtx }];

Expand Down

0 comments on commit a2c64f8

Please sign in to comment.