Skip to content

Commit

Permalink
fix: solve bug with evolve button at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
JuniMay committed Mar 26, 2022
1 parent df41635 commit 4b6b79f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ void MainWindow::stop_evolve() {
}

void MainWindow::evolve_step() {
automaton_->evolve();
bool success = automaton_->evolve();
if (!success) {
logger_->log("Error occurred while evolving, stop.");
stop_evolve();
return;
}
viewer_->display_automaton();
}

Expand Down Expand Up @@ -231,4 +236,4 @@ void MainWindow::resize_automaton(const size_t& depth,
}
viewer_->reset_view();
viewer_->display_automaton();
}
}

0 comments on commit 4b6b79f

Please sign in to comment.