diff --git a/algos/map_behavior.cpp b/algos/map_behavior.cpp index a94233b..9a2a20e 100644 --- a/algos/map_behavior.cpp +++ b/algos/map_behavior.cpp @@ -257,17 +257,19 @@ void MapBehavior::handle_event(engine& e, const sf::Event& event) // TODO: this is duumb, make better swapping code else if (event.key.code == sf::Keyboard::O) { + bool was_paused = paused; paused = true; while (evolving); - map.set_metric(std::make_unique()); - paused = false; + map.set_metric(std::make_unique()); + if (!was_paused) paused = false; } else if (event.key.code == sf::Keyboard::P) { + bool was_paused = paused; paused = true; while (evolving); map.set_metric(std::make_unique()); - paused = false; + if (!was_paused) paused = false; } } diff --git a/main.cpp b/main.cpp index 13cf4b5..4dda3cf 100644 --- a/main.cpp +++ b/main.cpp @@ -9,7 +9,7 @@ gm::Map get_map() { return gm::Map ( - std::make_unique(), + std::make_unique(), gm::Map::Settings{ 12, 0.1 }, gm::Map::Grid{200, 200} );