Move clear_telegram_is_new() call to beginning of update

The call was added in 4.2.5 "so that the next telegram is flagged as
new and not part of the update".  Since the update sends only
TEL_UPDATE telegrams (the previous commit restored that property), and
nothing else does, the next telegram is flagged as new automatically,
except when it's from the next update.  Document that, and move the
call to a more natural place.
This commit is contained in:
Markus Armbruster 2011-11-20 18:30:39 +01:00
parent d46b168663
commit ac5dac0690

View file

@ -60,13 +60,15 @@ update_main(void)
int n; int n;
int i; int i;
struct bp *bp; struct bp *bp;
int cn;
struct natstr *np; struct natstr *np;
logerror("production update (%d etus)", etu); logerror("production update (%d etus)", etu);
getrusage(RUSAGE_SELF, &rus1); getrusage(RUSAGE_SELF, &rus1);
game_record_update(time(NULL)); game_record_update(time(NULL));
journal_update(etu); journal_update(etu);
/* Ensure back-to-back production reports are separate: */
for (n = 0; n < MAXNOC; n++)
clear_telegram_is_new(n);
/* First, make sure all mobility is updated correctly. */ /* First, make sure all mobility is updated correctly. */
if (opt_MOB_ACCESS) { if (opt_MOB_ACCESS) {
@ -153,9 +155,6 @@ update_main(void)
delete_old_announcements(); delete_old_announcements();
delete_old_news(); delete_old_news();
delete_old_lostitems(); delete_old_lostitems();
/* Clear all the telegram flags */
for (cn = 0; cn < MAXNOC; cn++)
clear_telegram_is_new(cn);
getrusage(RUSAGE_SELF, &rus2); getrusage(RUSAGE_SELF, &rus2);
logerror("End update %g user %g system", logerror("End update %g user %g system",
rus2.ru_utime.tv_sec + rus2.ru_utime.tv_usec / 1e6 rus2.ru_utime.tv_sec + rus2.ru_utime.tv_usec / 1e6