diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 41937d54..ba424a40 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -877,8 +877,6 @@ void startmap(const char *name, bool reset) // called just after a map load } } - resetspawns(); // double check - // run once if(firstrun) { diff --git a/source/src/server.cpp b/source/src/server.cpp index 8de00530..ccbe8e84 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -681,8 +681,6 @@ void readdemo() } } -// - struct sflaginfo { int state; @@ -712,6 +710,14 @@ void putflaginfo(packetbuf &p, int flag) } } +inline void send_item_list(packetbuf &p) +{ + putint(p, SV_ITEMLIST); + loopv(sents) if(sents[i].spawned) putint(p, i); + putint(p, -1); + if(m_flags) loopi(2) putflaginfo(p, i); +} + #include "serverchecks.h" bool flagdistance(sflaginfo &f, int cn) @@ -1745,13 +1751,6 @@ void startdemoplayback(const char *newname) setupdemoplayback(); } -inline void send_item_list(packetbuf &p) -{ - putint(p, SV_ITEMLIST); - loopv(sents) if(sents[i].spawned) putint(p, i); - putint(p, -1); -} - void startgame(const char *newname, int newmode, int newtime, bool notify) { if(!newname || !*newname || (newmode == GMODE_DEMO && isdedicated)) fatal("startgame() abused"); @@ -1813,10 +1812,10 @@ void startgame(const char *newname, int newmode, int newtime, bool notify) // change map sendf(-1, 1, "risiii", SV_MAPCHANGE, smapname, smode, mapbuffer.available(), mapbuffer.revision); if(smode>1 || (smode==0 && numnonlocalclients()>0)) sendf(-1, 1, "ri2", SV_TIMEUP, minremain); - packetbuf q(MAXTRANS, ENET_PACKET_FLAG_RELIABLE); - send_item_list(q); - sendpacket(-1, 1, q.finalize()); } + packetbuf q(MAXTRANS, ENET_PACKET_FLAG_RELIABLE); + send_item_list(q); // always send the item list when a game starts + sendpacket(-1, 1, q.finalize()); defformatstring(gsmsg)("Game start: %s on %s, %d players, %d minutes, mastermode %d, ", modestr(smode), smapname, numclients(), minremain, mastermode); if(mastermode == MM_MATCH) concatformatstring(gsmsg, "teamsize %d, ", matchteamsize); if(ms) concatformatstring(gsmsg, "(map rev %d/%d, %s, 'getmap' %sprepared)", smapstats.hdr.maprevision, smapstats.cgzsize, maplocstr[maploc], mapbuffer.available() ? "" : "not "); @@ -2344,8 +2343,7 @@ void welcomepacket(packetbuf &p, int n) putint(p, SV_TIMEUP); putint(p, minremain); } - send_item_list(p); - if(m_flags) loopi(2) putflaginfo(p, i); + send_item_list(p); // this includes the flags } savedscore *sc = NULL; if(c)