From 990f6e9c8b6a6bda92db76cdf77b5aa3526b0b08 Mon Sep 17 00:00:00 2001 From: aurhat Date: Sat, 6 Dec 2014 17:17:19 +0100 Subject: [PATCH] Fix output messages in console Fixes: 1. show time remaining in system console after each minute; 2. correct form of minute(s); 3. show info "everyone died!" instead of "team SPECTATOR has won the round!" in demo mode; 4. show correct info to which team (name) was player forced, when player1 is spectator. --- source/src/clientgame.cpp | 3 ++- source/src/clients2c.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 9c4fef9b..e0020e5b 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -993,6 +993,7 @@ void timeupdate(int milliscur, int millismax) if(identexists("onLastMin")) execute("onLastMin"); } else if(clockdisplay==0) conoutf(_("time remaining: %d minutes"), minutesremaining); + else clientlogf(_("time remaining: %d minutes"), minutesremaining); } } @@ -1344,7 +1345,7 @@ char *votestring(int type, const char *arg1, const char *arg2, const char *arg3) if(arg3 && arg3[0]) { int time = atoi(arg3); - if(time > 0 && time != defaultgamelimit(n)) formatstring(timestr)(" for %d minutes", time); + if(time > 0 && time != defaultgamelimit(n)) formatstring(timestr)(" for %d minute%s", time, time == 1 ? "" : "s"); } if ( n >= GMODE_NUM ) diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 44d12371..7f2355a6 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -1092,7 +1092,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p, bool demo = false) playerent *alive = getclient(acn); conoutf(_("the round is over! next round in 5 seconds...")); if(m_botmode && acn==-2) hudoutf(_("the bots have won the round!")); - else if(!alive) hudoutf(_("everyone died!")); + else if(acn==-1) hudoutf(_("everyone died!")); else if(m_teammode) hudoutf(_("team %s has won the round!"), team_string(alive->team)); else if(alive==player1) hudoutf(_("you are the survivor!")); else hudoutf(_("%s is the survivor!"), colorname(alive)); @@ -1194,7 +1194,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p, bool demo = false) conoutf(_("player %s switched to team %s"), pls, nts); // new message break; case FTR_AUTOTEAM: - if(watchingdemo) conoutf(_("the server forced %s to team %s"), colorname(d), nts); + if(watchingdemo || team_isspect(player1->team)) conoutf(_("the server forced %s to team %s"), colorname(d), nts); else hudoutf(_("the server forced %s to %s team"), colorname(d), et ? _("the enemy") : _("your")); break; }