aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/GameManager.cpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-09-09 16:00:23 +0200
committer Hop311 <hop3114@gmail.com>2023-09-09 22:50:29 +0200
commitb4220ad73e14e3b497b2fdeb83d76a6633664764 (patch)
tree72aee7b62ca2a1714799ff8f477ca1e50407eca8 /src/openvic-simulation/GameManager.cpp
parent7772f8871348b7b52cb0a478bb76df68d8799a07 (diff)
PR feedback + Logger::warning
Diffstat (limited to 'src/openvic-simulation/GameManager.cpp')
-rw-r--r--src/openvic-simulation/GameManager.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/openvic-simulation/GameManager.cpp b/src/openvic-simulation/GameManager.cpp
index ee5050d..0b42230 100644
--- a/src/openvic-simulation/GameManager.cpp
+++ b/src/openvic-simulation/GameManager.cpp
@@ -13,12 +13,11 @@ void GameManager::set_needs_update() {
}
void GameManager::update_state() {
- if (needs_update) {
- Logger::info("Update: ", today);
- map.update_state(today);
- if (state_updated) state_updated();
- needs_update = false;
- }
+ if (!needs_update) return;
+ Logger::info("Update: ", today);
+ map.update_state(today);
+ if (state_updated) state_updated();
+ needs_update = false;
}
/* REQUIREMENTS: