*/
void CL_NextDemo (void)
{
- char str[1024];
+ char str[MAX_INPUTLINE];
if (cls.demonum == -1)
return; // don't play demos
if (cls.timedemo)
CL_FinishTimeDemo ();
+
+ if (COM_CheckParm("-demo") || COM_CheckParm("-demolooponly"))
+ Host_Quit_f();
+
}
/*
VectorCopy(cl.mviewangles[0], cl.mviewangles[1]);
for (i = 0;i < 3;i++)
{
- r = FS_Read(cls.demofile, &f, 4);
+ r = (int)FS_Read(cls.demofile, &f, 4);
cl.mviewangles[0][i] = LittleFloat(f);
}
- if (FS_Read(cls.demofile, net_message.data, net_message.cursize) == (size_t)net_message.cursize)
+ if (FS_Read(cls.demofile, net_message.data, net_message.cursize) == net_message.cursize)
{
MSG_BeginReading();
CL_ParseServerMessage();
// open the demo file
Con_Printf("recording to %s.\n", name);
- cls.demofile = FS_Open (name, "wb", false);
+ cls.demofile = FS_Open (name, "wb", false, false);
if (!cls.demofile)
{
Con_Print("ERROR: couldn't open.\n");
*/
void CL_PlayDemo_f (void)
{
- char name[256];
+ char name[MAX_QPATH];
int c;
qboolean neg = false;
// disconnect from server
CL_Disconnect ();
- Host_ShutdownServer (false);
+ Host_ShutdownServer ();
// update networking ports (this is mainly just needed at startup)
- NetConn_ClientFrame();
+ NetConn_UpdateSockets();
// open the demo file
strlcpy (name, Cmd_Argv(1), sizeof (name));
FS_DefaultExtension (name, ".dem", sizeof (name));
Con_Printf("Playing demo from %s.\n", name);
- cls.demofile = FS_Open (name, "rb", false);
+ cls.demofile = FS_Open (name, "rb", false, false);
if (!cls.demofile)
{
Con_Print("ERROR: couldn't open.\n");
cls.timedemo = true;
// get first message this frame
- cls.td_lastframe = -1;
+ cls.td_lastframe = -1;
}