mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Stopwatch: checking protocol at runtime instead
This commit is contained in:
parent
0f0fbb7b0d
commit
8418da422c
1 changed files with 11 additions and 21 deletions
|
@ -219,32 +219,22 @@ CG_Stopwatch_f
|
|||
|
||||
================
|
||||
*/
|
||||
#if TARGET_GAME_PROTOCOL >= 15
|
||||
|
||||
static void CG_Stopwatch_f()
|
||||
{
|
||||
if (cgi.Argc() < 3) {
|
||||
Com_Error(ERR_DROP, "stopwatch didn't have 2 parameters");
|
||||
}
|
||||
if (cgi.Argc() < 3) {
|
||||
Com_Error(ERR_DROP, "stopwatch didn't have 2 parameters");
|
||||
}
|
||||
|
||||
cgi.stopWatch->iStartTime = atoi(cgi.Argv(1));
|
||||
cgi.stopWatch->iEndTime = cgi.stopWatch->iStartTime + 1000 * atoi(cgi.Argv(2));
|
||||
if (cgi.protocol >= PROTOCOL_MOHTA_MIN) {
|
||||
cgi.stopWatch->iStartTime = atoi(cgi.Argv(1));
|
||||
} else {
|
||||
// The base game has it wrong
|
||||
cgi.stopWatch->iStartTime = 1000 * atoi(cgi.Argv(1));
|
||||
}
|
||||
|
||||
cgi.stopWatch->iEndTime = cgi.stopWatch->iStartTime + 1000 * atoi(cgi.Argv(2));
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void CG_Stopwatch_f()
|
||||
{
|
||||
if (cgi.Argc() < 3) {
|
||||
Com_Error(ERR_DROP, "stopwatch didn't have 2 parameters");
|
||||
}
|
||||
|
||||
cgi.stopWatch->iStartTime = 1000 * atoi(cgi.Argv(1));
|
||||
cgi.stopWatch->iEndTime = cgi.stopWatch->iStartTime + 1000 * atoi(cgi.Argv(2));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
================
|
||||
CG_ServerLag_f
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue