break multiline texts before echoing

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4349 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
ac_stef
2009-04-26 15:04:38 +00:00
parent 97b04db2a7
commit eb626c4f47
+10 -1
View File
@@ -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);