From ac5dac06905e96c8054686af5ac9ecfd31c03e4d Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 20 Nov 2011 18:30:39 +0100 Subject: [PATCH] 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. --- src/lib/update/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/update/main.c b/src/lib/update/main.c index 4a6a3db12..cc4d6e155 100644 --- a/src/lib/update/main.c +++ b/src/lib/update/main.c @@ -60,13 +60,15 @@ update_main(void) int n; int i; struct bp *bp; - int cn; struct natstr *np; logerror("production update (%d etus)", etu); getrusage(RUSAGE_SELF, &rus1); game_record_update(time(NULL)); 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. */ if (opt_MOB_ACCESS) { @@ -153,9 +155,6 @@ update_main(void) delete_old_announcements(); delete_old_news(); delete_old_lostitems(); - /* Clear all the telegram flags */ - for (cn = 0; cn < MAXNOC; cn++) - clear_telegram_is_new(cn); getrusage(RUSAGE_SELF, &rus2); logerror("End update %g user %g system", rus2.ru_utime.tv_sec + rus2.ru_utime.tv_usec / 1e6 -- 2.43.0