Make mpr()'s behavior on zero first argument more obvious
This commit is contained in:
parent
5fda0594e4
commit
4c0d843c01
1 changed files with 9 additions and 8 deletions
|
@ -507,8 +507,9 @@ pr_beep(void)
|
||||||
/*
|
/*
|
||||||
* Print to country CN similar to printf().
|
* Print to country CN similar to printf().
|
||||||
* Use printf-style FORMAT with the optional arguments.
|
* Use printf-style FORMAT with the optional arguments.
|
||||||
* If CN is the current player and we're not in the update, print just
|
* If CN is zero, don't print anything.
|
||||||
* like pr(). Else print into a bulletin.
|
* Else, if CN is the current player and we're not in the update,
|
||||||
|
* print just like pr(). Else print into a bulletin.
|
||||||
* Because printing like pr() requires normal text, and bulletins
|
* Because printing like pr() requires normal text, and bulletins
|
||||||
* require user text, only plain ASCII is allowed.
|
* require user text, only plain ASCII is allowed.
|
||||||
*/
|
*/
|
||||||
|
@ -518,15 +519,15 @@ mpr(int cn, char *format, ...)
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
if (!cn)
|
||||||
|
return;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
(void)vsprintf(buf, format, ap);
|
(void)vsprintf(buf, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
if (cn) {
|
if (update_running || cn != player->cnum)
|
||||||
if (update_running || cn != player->cnum)
|
typed_wu(0, cn, buf, TEL_BULLETIN);
|
||||||
typed_wu(0, cn, buf, TEL_BULLETIN);
|
else
|
||||||
else
|
pr_player(player, C_DATA, buf);
|
||||||
pr_player(player, C_DATA, buf);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue