diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index c815388e..f3c93eff 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -514,6 +514,9 @@ void preparectf(bool cleanonly=false) e.spawned = true; if(e.attr2>2) { conoutf("\f3invalid ctf-flag entity (%i)", i); e.attr2 = 0; } flaginfo &f = flaginfos[e.attr2]; + f.ack = false; + f.actor = NULL; + f.actor_cn = -1; f.team = e.attr2; f.flag = &e; f.state = CTFF_INBASE; diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index aa9c1d51..92e51e79 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -137,7 +137,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) } case SV_SOUND: - playsound(getint(p), !d || localdemoplayer1st() ? NULL : &d->o); + playsound(getint(p), !d || (localdemoplayer1st() && cn==democlientnum) ? NULL : &d->o); break; diff --git a/source/src/rendertext.cpp b/source/src/rendertext.cpp index 38b7f7fb..47c33594 100644 --- a/source/src/rendertext.cpp +++ b/source/src/rendertext.cpp @@ -90,6 +90,7 @@ void text_endcolumns() int text_width(const char *str, int limit) { + if(!str) return 0; int x = 0, col = 0; for(int i = 0; str[i] && (limit<0 || iflagscore, d->frags, d->lifesequence, d->state==CS_LAGGED ? "LAG" : lag, d->ping, d->team, status, colorname(d), cn); else if(m_teammode) s_sprintf(s)("%d\t%d\t%s\t%d\t%s\t%s%s\t%d", d->frags, d->lifesequence, d->state==CS_LAGGED ? "LAG" : lag, d->ping, m_teammode ? d->team : "", status, colorname(d), cn); else s_sprintf(s)("%d\t%d\t%s\t%d\t%s%s\t%d", d->frags, d->lifesequence, d->state==CS_LAGGED ? "LAG" : lag, d->ping, status, colorname(d), cn); - menumanual(menu, scorelines.length()-1, s); } static int scorecmp(const playerent **x, const playerent **y) @@ -100,7 +99,7 @@ void renderscores(void *menu, bool init) else s_sprintf(s)("[ %s: %d ]", teamscores[i].team, teamscores[i].score); s_strcat(teamline, s); } - menumanual(menu, scorelines.length(), teamline); } + loopv(scorelines) menumanual(menu, i, scorelines[i].s); }