Skip to content

Commit

Permalink
Fix "Not in a step" exception w/ battle calc.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvitkine committed Jun 19, 2022
1 parent 8daa2f4 commit 5dfe276
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,15 @@ public void setHistory(final History history) {

public void resetHistory() {
gameHistory = new History(this);
GameStep step = getSequence().getStep();
// Put the history in a round and step, so that child nodes can be added without errors.
gameHistory
.getHistoryWriter()
.startNextStep(
step.getName(),
step.getDelegate().getName(),
step.getPlayerId(),
step.getDisplayName());
}

/** Not to be called by mere mortals. */
Expand Down

0 comments on commit 5dfe276

Please sign in to comment.