From c0bab02a53fec0d32fa5b5388a9d5494dfba6244 Mon Sep 17 00:00:00 2001 From: ac_stef Date: Wed, 3 Dec 2008 21:03:10 +0000 Subject: [PATCH] stop demo playback before connecting (bug 2367286) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3861 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/client.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/src/client.cpp b/source/src/client.cpp index 77404ecb..8357b427 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -10,6 +10,7 @@ ENetHost *clienthost = NULL; ENetPeer *curpeer = NULL, *connpeer = NULL; int connmillis = 0, connattempts = 0, discmillis = 0; bool c2sinit = false; // whether we need to tell the other clients our stats +bool watchingdemo = false; // flowtron : enables SV_ITEMLIST in demos - req. because mapchanged == false by then int getclientnum() { return player1 ? player1->clientnum : -1; } @@ -61,6 +62,8 @@ void abortconnect() void connectserv_(const char *servername, const char *serverport = NULL, const char *password = NULL, int role = CR_DEFAULT) { + extern void enddemoplayback(); + if(watchingdemo) enddemoplayback(); if(connpeer) { conoutf("aborting connection attempt"); @@ -266,7 +269,6 @@ void addmsg(int type, const char *fmt, ...) static int lastupdate = -1000, lastping = 0; bool senditemstoserver = false; // after a map change, since server doesn't have map data -bool watchingdemo = false; // flowtron : enables SV_ITEMLIST in demos - req. because mapchanged == false by then void sendpackettoserv(int chan, ENetPacket *packet) {