void SV_StartDemoRecording(client_t *client, const char *filename, int forcetrack)
{
char name[MAX_QPATH];
- prvm_eval_t *val;
if(client->sv_demo_file != NULL)
return; // we already have a demo
Con_Printf("Recording demo for # %d (%s) to %s\n", PRVM_NUM_FOR_EDICT(client->edict), client->netaddress, name);
// Reset discardable flag for every new demo.
- if ((val = PRVM_EDICTFIELDVALUE(client->edict, prog->fieldoffsets.discardabledemo)))
- val->_float = 0;
+ PRVM_serveredictfloat(client->edict, discardabledemo) = 0;
client->sv_demo_file = FS_OpenRealFile(name, "wb", false);
if(!client->sv_demo_file)
{
sizebuf_t buf;
unsigned char bufdata[64];
- prvm_eval_t *val;
if(client->sv_demo_file == NULL)
return;
MSG_WriteByte(&buf, svc_disconnect);
SV_WriteDemoMessage(client, &buf, false);
- if (sv_autodemo_perclient_discardable.integer && (val = PRVM_EDICTFIELDVALUE(client->edict, prog->fieldoffsets.discardabledemo)) && val->_float)
+ if (sv_autodemo_perclient_discardable.integer && PRVM_serveredictfloat(client->edict, discardabledemo))
{
FS_RemoveOnClose(client->sv_demo_file);
Con_Printf("Stopped recording discardable demo for # %d (%s)\n", PRVM_NUM_FOR_EDICT(client->edict), client->netaddress);