ggpo: static rtc when ggpo is enabled

This commit is contained in:
Enrique Santos 2021-09-04 19:20:09 +03:00 committed by flyinghead
parent e3aca85efd
commit dba805e8c4
1 changed files with 6 additions and 1 deletions

View File

@ -37,6 +37,11 @@ u32 GetRTC_now()
gmtm.tm_isdst = -1; gmtm.tm_isdst = -1;
time_t time_offset = mktime(&localtm) - mktime(&gmtm); time_t time_offset = mktime(&localtm) - mktime(&gmtm);
// 1/1/50 to 1/1/70 is 20 years and 5 leap days // 1/1/50 to 1/1/70 is 20 years and 5 leap days
// rtc kept static for netplay when savestate is not loaded
if (config::GGPOEnable)
return (20 * 365 + 5) * 24 * 60 * 60;
else
return (20 * 365 + 5) * 24 * 60 * 60 + rawtime + time_offset; return (20 * 365 + 5) * 24 * 60 * 60 + rawtime + time_offset;
} }