Permalink
Browse files

fix crash when undoing if there were no snapshots

  • Loading branch information...
jacob1 committed Feb 19, 2017
1 parent 2967cde commit 61e19a3237fef83dbb1434769cde51a886d11667
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/gui/game/GameController.cpp
@@ -233,6 +233,8 @@ GameController::~GameController()
void GameController::HistoryRestore()
{
std::deque<Snapshot*> history = gameModel->GetHistory();
if (!history.size())
return;
unsigned int historyPosition = gameModel->GetHistoryPosition();
unsigned int newHistoryPosition = std::max((int)historyPosition-1, 0);
// When undoing, save the current state as a final redo

0 comments on commit 61e19a3

Please sign in to comment.