From e39af72d14bbd23bed7cef3d9a36f091a653916c Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sat, 3 Oct 2009 17:26:02 +0000 Subject: [PATCH] Bugfixes, damit die Demos wieder gehen. Kommt morgen noch mehr nach. --- src/server/sv_main.c | 4 ++-- src/server/sv_send.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/server/sv_main.c b/src/server/sv_main.c index 02ea91a0..0e5d5b0f 100644 --- a/src/server/sv_main.c +++ b/src/server/sv_main.c @@ -1030,7 +1030,7 @@ void SV_Shutdown (char *finalmsg, qboolean reconnect) // free current level if (sv.demofile) - fclose (sv.demofile); + FS_FCloseFile (sv.demofile); memset (&sv, 0, sizeof(sv)); Com_SetServerState (sv.state); @@ -1040,7 +1040,7 @@ void SV_Shutdown (char *finalmsg, qboolean reconnect) if (svs.client_entities) Z_Free (svs.client_entities); if (svs.demofile) - fclose (svs.demofile); + FS_FCloseFile (svs.demofile); memset (&svs, 0, sizeof(svs)); } diff --git a/src/server/sv_send.c b/src/server/sv_send.c index 24cc4408..71ae0db3 100644 --- a/src/server/sv_send.c +++ b/src/server/sv_send.c @@ -438,7 +438,7 @@ void SV_DemoCompleted (void) { if (sv.demofile) { - fclose (sv.demofile); + FS_FCloseFile (sv.demofile); sv.demofile = NULL; } SV_Nextserver (); @@ -502,8 +502,8 @@ void SV_SendClientMessages (void) else { // get the next message - r = fread (&msglen, 4, 1, sv.demofile); - if (r != 1) + r = FS_FRead (&msglen, 4, 1, sv.demofile); + if (r != 4) { SV_DemoCompleted (); return; @@ -516,8 +516,8 @@ void SV_SendClientMessages (void) } if (msglen > MAX_MSGLEN) Com_Error (ERR_DROP, "SV_SendClientMessages: msglen > MAX_MSGLEN"); - r = fread (msgbuf, msglen, 1, sv.demofile); - if (r != 1) + r = FS_FRead (msgbuf, msglen, 1, sv.demofile); + if (r != msglen) { SV_DemoCompleted (); return;