cvar_t csqc_progname = {0, "csqc_progname","csprogs.dat","name of csprogs.dat file to load"};
cvar_t csqc_progcrc = {CVAR_READONLY, "csqc_progcrc","-1","CRC of csprogs.dat file to load (-1 is none), only used during level changes and then reset to -1"};
cvar_t csqc_progsize = {CVAR_READONLY, "csqc_progsize","-1","file size of csprogs.dat file to load (-1 is none), only used during level changes and then reset to -1"};
+cvar_t csqc_usedemoprogs = {0, "csqc_usedemoprogs","1","use csprogs stored in demos"};
cvar_t cl_shownet = {0, "cl_shownet","0","1 = print packet size, 2 = print packet message list"};
cvar_t cl_nolerp = {0, "cl_nolerp", "0","network update smoothing"};
return false;
}
+extern cvar_t csqc_usedemoprogs;
void CL_VM_Init (void)
{
const char* csprogsfn;
- unsigned char *csprogsdata;
+ unsigned char *csprogsdata = NULL;
fs_offset_t csprogsdatasize;
int csprogsdatacrc, requiredcrc;
int requiredsize;
// see if the requested csprogs.dat file matches the requested crc
csprogsdatacrc = -1;
- csprogsfn = va("dlcache/%s.%i.%i", csqc_progname.string, requiredsize, requiredcrc);
- csprogsdata = FS_LoadFile(csprogsfn, tempmempool, true, &csprogsdatasize);
+ if (!cls.demoplayback || csqc_usedemoprogs.integer)
+ {
+ csprogsfn = va("dlcache/%s.%i.%i", csqc_progname.string, requiredsize, requiredcrc);
+ csprogsdata = FS_LoadFile(csprogsfn, tempmempool, true, &csprogsdatasize);
+ }
if (!csprogsdata)
{
csprogsfn = csqc_progname.string;
extern cvar_t csqc_progname; //[515]: csqc crc check and right csprogs name according to progs.dat
extern cvar_t csqc_progcrc;
extern cvar_t csqc_progsize;
+ extern cvar_t csqc_usedemoprogs;
Cvar_RegisterVariable(&sv_worldmessage);
Cvar_RegisterVariable(&sv_worldname);
Cvar_RegisterVariable (&csqc_progname);
Cvar_RegisterVariable (&csqc_progcrc);
Cvar_RegisterVariable (&csqc_progsize);
+ Cvar_RegisterVariable (&csqc_usedemoprogs);
Cmd_AddCommand("sv_saveentfile", SV_SaveEntFile_f, "save map entities to .ent file (to allow external editing)");
Cmd_AddCommand("sv_areastats", SV_AreaStats_f, "prints statistics on entity culling during collision traces");