From a48a0d4eb8e8d98b7646b93b6b19fd89d9c31dc0 Mon Sep 17 00:00:00 2001 From: Myles Pasetsky Date: Sun, 26 Jun 2022 20:42:14 -0400 Subject: [PATCH] change lock code, parties to use --- algos/map_behavior.cpp | 8 +++++--- main.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) 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} );