Don't lie "You have a new telegram" after read with inform off
Here's how telegram notification works with NF_INFORM off: typed_wu() increments the telegram recipient's nat_tgms. status(), running right before command prompts, notifies the player when nat_tgms > 0, and resets it. Thus, we tell the player how many telegrams arrived since the previous command prompt. However, what we really want is something else, namely the number of "new telegrams waiting". That's what the notification message says, after all. Telegrams already printed by read shouldn't count, even when they arrived since the previous command prompt. Make them not count by clearing pending telegrams on read regardless of toggle inform. Same for announcements.
This commit is contained in:
parent
e8f0495950
commit
4d046738fd
1 changed files with 5 additions and 3 deletions
|
@ -132,13 +132,15 @@ rea(void)
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
pr("\n> Mailbox corrupt, tell the deity.\n");
|
pr("\n> Mailbox corrupt, tell the deity.\n");
|
||||||
|
|
||||||
if (*kind != 'a') {
|
if (*kind == 'a')
|
||||||
|
np->nat_ann = 0;
|
||||||
|
else {
|
||||||
|
np->nat_tgms = 0;
|
||||||
if (np->nat_flags & NF_INFORM) {
|
if (np->nat_flags & NF_INFORM) {
|
||||||
pr_inform(player, "\n");
|
pr_inform(player, "\n");
|
||||||
np->nat_tgms = 0;
|
}
|
||||||
|
}
|
||||||
putnat(np);
|
putnat(np);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (teles > 0 && player->cnum == num && may_delete) {
|
if (teles > 0 && player->cnum == num && may_delete) {
|
||||||
pr("\n");
|
pr("\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue