From 785e38c507dc378780d094032abbe1d135d3705d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Sat, 19 Jun 2021 15:38:22 +0200 Subject: [PATCH] timer support but there's a bug when saving & loading consecutively (without restart) --- sources/Parser/ParserYaml.cpp | 2 +- sources/Runner/Runner.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/Parser/ParserYaml.cpp b/sources/Parser/ParserYaml.cpp index 8a3900fb..9aed6df4 100644 --- a/sources/Parser/ParserYaml.cpp +++ b/sources/Parser/ParserYaml.cpp @@ -239,7 +239,7 @@ namespace BBM { Runner::mapHeight = size; long timer = 0; if (!Utils::tryParseLong(node.getProperty("timer"), timer)) { - throw ParserError("timer property parsing error (must be a long)"); + throw ParserError("timer property must be a long"); } Runner::timerDelay = std::chrono::nanoseconds(timer); diff --git a/sources/Runner/Runner.cpp b/sources/Runner/Runner.cpp index 7f2db6ac..6be7a515 100644 --- a/sources/Runner/Runner.cpp +++ b/sources/Runner/Runner.cpp @@ -48,11 +48,11 @@ namespace BBM { + std::chrono::nanoseconds Runner::timerDelay = std::chrono::minutes(3); GameState Runner::gameState; int Runner::mapWidth = 16; int Runner::mapHeight = 16; bool Runner::hasHeights = false; - std::chrono::nanoseconds timerDelay = std::chrono::minutes(3); void Runner::updateState(WAL::Wal &engine, GameState &state) {