From 99142603cbb3607fae7a63df8902bd871a5954dc Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Fri, 27 Aug 2021 18:35:15 +0000 Subject: [PATCH] Added timer fix suggested by Terapevt to avoid incorrect signed/unsigned comparison later. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9157 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Utils/Timer Control.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Utils/Timer Control.cpp b/Utils/Timer Control.cpp index 830d0196..06617cbd 100644 --- a/Utils/Timer Control.cpp +++ b/Utils/Timer Control.cpp @@ -209,6 +209,10 @@ void CALLBACK TimeProc( UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2 guiBaseJA2Clock += BASETIMESLICE; + // Terapevt suggested fix + if ((INT32)guiBaseJA2Clock < 0) + guiBaseJA2Clock = 0; + // detect overflow if (uiOldClock > guiBaseJA2Clock) {