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
This commit is contained in:
flowtron
2008-06-06 06:57:04 +00:00
parent c49310fb69
commit 2ddb232ba9
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -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)
{
+4 -4
View File
@@ -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;