2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-17 09:07:54 +03:00

Fixed bug in challenge generator.

This commit is contained in:
asmodai 2015-07-14 15:01:40 +03:00
parent d3d296cbcc
commit a3094b3719

View File

@ -2454,7 +2454,11 @@ void SVC_GetChallenge(void)
i = oldest;
#endif
// generate new challenge number
#ifdef REHLDS_FIXES
g_rg_sv_challenges[i].challenge = (RandomLong(0, 0x7fff) << 16) | (RandomLong(0, 0xffff));
#else // REHLDS_FIXES
g_rg_sv_challenges[i].challenge = (RandomLong(0, 36863) << 16) | (RandomLong(0, 65535));
#endif // REHLDS_FIXES
g_rg_sv_challenges[i].adr = net_from;
g_rg_sv_challenges[i].time = (int)realtime;
}
@ -2517,7 +2521,11 @@ void SVC_ServiceChallenge(void)
i = oldest;
#endif
// generate new challenge number
#ifdef REHLDS_FIXES
g_rg_sv_challenges[i].challenge = (RandomLong(0, 0x7fff) << 16) | (RandomLong(0, 0xffff));
#else // REHLDS_FIXES
g_rg_sv_challenges[i].challenge = (RandomLong(0, 36863) << 16) | (RandomLong(0, 65535));
#endif // REHLDS_FIXES
g_rg_sv_challenges[i].adr = net_from;
g_rg_sv_challenges[i].time = (int)realtime;
}