}
extern cvar_t slowmo;
+extern void CSQC_UpdateNetworkTimes(double newtime, double oldtime);
static void CL_NetworkTimeReceived(double newtime)
{
double timehigh;
cl.fixangle[0] = false;
if (!cls.demoplayback)
VectorCopy(cl.mviewangles[0], cl.mviewangles[1]);
+ // update the csqc's server timestamps, critical for proper sync
+ CSQC_UpdateNetworkTimes(cl.mtime[0], cl.mtime[1]);
}
#define SHOWNET(x) if(cl_shownet.integer==2)Con_Printf("%3i:%s(%i)\n", msg_readcount-1, x, cmd);
CSQC_END
}
}
+
+void CSQC_UpdateNetworkTimes(double newtime, double oldtime)
+{
+ prvm_eval_t *val;
+ if(!cl.csqc_loaded)
+ return;
+ CSQC_BEGIN
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.servertime)))
+ val->_float = newtime;
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.serverprevtime)))
+ val->_float = oldtime;
+ if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.serverdeltatime)))
+ val->_float = newtime - oldtime;
+ CSQC_END
+}
+
//[515]: set globals before calling R_UpdateView, WEIRD CRAP
static void CSQC_SetGlobals (void)
{
int drawfont; // csqc / menu
int require_spawnfunc_prefix; // ssqc
int worldstatus; // ssqc
+ int servertime; // csqc
+ int serverprevtime; // csqc
+ int serverdeltatime; // csqc
}
prvm_prog_globaloffsets_t;