X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=sv_demo.c;h=08ebe8411bb0e8615fef4bed77fd99d8ce0a8479;hp=c237f2f43a4b649189779509c179fe6cca596306;hb=f50a1192fbe86bfdd69d3372620db0b661db5f20;hpb=e660b4c0147da9f4b5db110a05cfbadcea6b1b64 diff --git a/sv_demo.c b/sv_demo.c index c237f2f4..08ebe841 100644 --- a/sv_demo.c +++ b/sv_demo.c @@ -5,6 +5,7 @@ extern cvar_t sv_autodemo_perclient_discardable; void SV_StartDemoRecording(client_t *client, const char *filename, int forcetrack) { + prvm_prog_t *prog = SVVM_prog; char name[MAX_QPATH]; if(client->sv_demo_file != NULL) @@ -21,15 +22,16 @@ void SV_StartDemoRecording(client_t *client, const char *filename, int forcetrac client->sv_demo_file = FS_OpenRealFile(name, "wb", false); if(!client->sv_demo_file) { - Con_Print("ERROR: couldn't open.\n"); + Con_Print(CON_ERROR "ERROR: couldn't open.\n"); return; } FS_Printf(client->sv_demo_file, "%i\n", forcetrack); } -void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qboolean clienttoserver) +void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qbool clienttoserver) { + prvm_prog_t *prog = SVVM_prog; int len, i; float f; int temp; @@ -44,7 +46,7 @@ void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qboolean clien FS_Write(client->sv_demo_file, &len, 4); for(i = 0; i < 3; ++i) { - f = LittleFloat(client->edict->fields.server->v_angle[i]); + f = LittleFloat(PRVM_serveredictvector(client->edict, v_angle)[i]); FS_Write(client->sv_demo_file, &f, 4); } FS_Write(client->sv_demo_file, sendbuffer->data, sendbuffer->cursize); @@ -52,6 +54,7 @@ void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qboolean clien void SV_StopDemoRecording(client_t *client) { + prvm_prog_t *prog = SVVM_prog; sizebuf_t buf; unsigned char bufdata[64]; @@ -80,7 +83,7 @@ void SV_WriteNetnameIntoDemo(client_t *client) { // This "pseudo packet" is written so a program can easily find out whose demo this is sizebuf_t buf; - unsigned char bufdata[128]; + unsigned char bufdata[MAX_SCOREBOARDNAME + 64]; if(client->sv_demo_file == NULL) return;