From fb1a68ba190b4a7ae53b591d568cbbec2f5b8965 Mon Sep 17 00:00:00 2001 From: Cockos Inc Date: Tue, 21 Apr 2020 20:22:27 -0400 Subject: [PATCH] When dealing with 32-bit timestamps from GetTickCount() use DWORD and (x-y) > diff rather than x > y + diff, etc. -- from 3c54d6d3 --- ninjam/server/usercon.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ninjam/server/usercon.cpp b/ninjam/server/usercon.cpp index 3ed3a882..839370c3 100644 --- a/ninjam/server/usercon.cpp +++ b/ninjam/server/usercon.cpp @@ -974,9 +974,10 @@ int User_Group::Run() // track bpm/bpi stuff #ifdef _WIN32 DWORD now=GetTickCount(); - if (now >= m_next_loop_time) + if (!m_next_loop_time || (now-m_next_loop_time) < 0x10000000) { m_next_loop_time = now + (60*1000*m_last_bpi) / (m_last_bpm?m_last_bpm:120); + if (!m_next_loop_time) m_next_loop_time++; #else struct timeval now; gettimeofday(&now,NULL);