]> git.pond.sub.org Git - empserver/commitdiff
Move clear_telegram_is_new() call to beginning of update
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 20 Nov 2011 17:30:39 +0000 (18:30 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 29 Dec 2011 10:47:06 +0000 (11:47 +0100)
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

index 4a6a3db1271a52374cdef3e47e5c8fc488446e6e..cc4d6e1550a9bef84d9d62256561f31c12e0e741 100644 (file)
@@ -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