Telegram deletion deletes the mailbox. If more telegrams arrive while
we wait for the player to confirm deletion, the mailbox again contains
unread telegrams, so we can't just delete it. Instead, rea() loops to
read the new telegrams.
Announcements worked the same until Empire 3 put them in a single file
shared by all. Since then, deleting announcements merely updates
nat_annotim, and there's no need to read new announcements after
getting the player's confirmation. So don't.
}
p = getstarg(player->argp[1], p, buf);
if (p && *p == 'y') {
}
p = getstarg(player->argp[1], p, buf);
if (p && *p == 'y') {
- if ((filelen = fsize(fileno(telfp))) > size) {
- pr("Wait a sec! A new %s has arrived...\n", kind);
- /* force stdio to re-read tel file */
- (void)fflush(telfp);
- (void)fseek(telfp, (long)size, SEEK_SET);
- size = filelen;
- now = time(NULL);
- goto more;
- }
if (*kind == 'a') {
np->nat_annotim = now;
putnat(np);
} else {
if (*kind == 'a') {
np->nat_annotim = now;
putnat(np);
} else {
+ if ((filelen = fsize(fileno(telfp))) > size) {
+ pr("Wait a sec! A new %s has arrived...\n", kind);
+ /* force stdio to re-read tel file */
+ (void)fflush(telfp);
+ (void)fseek(telfp, (long)size, SEEK_SET);
+ size = filelen;
+ now = time(NULL);
+ goto more;
+ }
/* Here, we just re-open the file for "w" only,
and that will wipe the file clean automatically */
(void)fclose(telfp);
/* Here, we just re-open the file for "w" only,
and that will wipe the file clean automatically */
(void)fclose(telfp);