Skip to content

Undo / redo validity condition seems wrong in the presence of stages #565

@ezyang

Description

@ezyang

Currently it says:

// Only allow UNDO / REDO if there is exactly one player
// that can make moves right now and the person doing the
// action is that player.
if (action.type == UNDO || action.type == REDO) {
if (
state.ctx.currentPlayer !== playerID ||
state.ctx.activePlayers !== null
) {
logging.error(`playerID=[${playerID}] cannot undo / redo right now`);
return;
}
}

But activePlayers can be non-null and there is only one valid player. For example:

activePlayers: {0: "selectColor"}

It seems to me that undo should be allowed in this case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions