From 089500ac9810d22588d8d44f58ef8a743e80f401 Mon Sep 17 00:00:00 2001 From: dP Date: Tue, 21 Jul 2020 20:35:05 +0300 Subject: [PATCH] Fix APM counter crash --- src/citymania/cm_hotkeys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/citymania/cm_hotkeys.cpp b/src/citymania/cm_hotkeys.cpp index 2d70bf7dea..d6984fe774 100644 --- a/src/citymania/cm_hotkeys.cpp +++ b/src/citymania/cm_hotkeys.cpp @@ -58,7 +58,7 @@ void ResetEffectivveActionCounter() { } std::pair GetEPM() { - if (!_first_effective_tick) return std::make_pair(0, 0); + if (!_first_effective_tick || _realtime_tick <= _first_effective_tick) return std::make_pair(0, 0); PurgeLastActions(); return std::make_pair(_effective_actions * 60000 / (_realtime_tick - _first_effective_tick), _last_actions.size()); }