From eb626c4f479333e5088bae87e67ced2462d5bc1d Mon Sep 17 00:00:00 2001 From: ac_stef Date: Sun, 26 Apr 2009 15:04:38 +0000 Subject: [PATCH] break multiline texts before echoing git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4349 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/client.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/src/client.cpp b/source/src/client.cpp index df468765..5669b451 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -201,7 +201,16 @@ void toserver(char *text) addmsg(toteam ? SV_TEAMTEXT : SV_TEXT, "rs", text); } -void echo(char *text) { conoutf("%s", text); } +void echo(char *text) +{ + const char *s = strtok(text, "\n"); + do + { + conoutf("%s", s ? s : ""); + s = strtok(NULL, "\n"); + } + while(s); +} COMMAND(echo, ARG_CONC); COMMANDN(say, toserver, ARG_CONC);