From 2ddb232ba9c1e513fa90ffb74e0d252ea9cf1aa3 Mon Sep 17 00:00:00 2001 From: flowtron Date: Fri, 6 Jun 2008 06:57:04 +0000 Subject: [PATCH] accept SV_ITEMLIST in a demo git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2154 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/client.cpp | 1 + source/src/clients2c.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/src/client.cpp b/source/src/client.cpp index 9fcedd82..32d77496 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -247,6 +247,7 @@ 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) { diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 78bddb00..d61da8c4 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -4,7 +4,7 @@ #include "cube.h" #include "bot/bot.h" -extern bool c2sinit, senditemstoserver; +extern bool c2sinit, senditemstoserver, watchingdemo; extern string clientpassword; void neterr(const char *s) @@ -222,8 +222,8 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) case SV_ITEMLIST: { int n; - if(mapchanged) { senditemstoserver = false; resetspawns(); } - while((n = getint(p))!=-1) if(mapchanged) setspawn(n, true); + if(mapchanged||watchingdemo) { senditemstoserver = false; resetspawns(); } + while((n = getint(p))!=-1) if(mapchanged||watchingdemo) setspawn(n, true); break; } @@ -674,7 +674,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) case SV_DEMOPLAYBACK: { - demoplayback = getint(p)!=0; + watchingdemo = demoplayback = getint(p)!=0; if(demoplayback) { player1->state = CS_SPECTATE;