(ANNO_KEEP_DAYS, anno_keep_days): Replace macro ANNO_KEEP_DAYS by

new configuration key.  Closes #780425.
(delete_old_announcements): Do nothing when anno_keep_days is
negative.
This commit is contained in:
Markus Armbruster 2004-08-28 15:28:54 +00:00
parent e16e38dfab
commit f0b4381c98
4 changed files with 7 additions and 2 deletions

View file

@ -81,6 +81,7 @@ int morale_base = 42; /* base for morale */
int sect_mob_neg_factor = 2; /* ETU/neg_factor = negative amount of mobility
a sector has after being taken */
int anno_keep_days = 7; /* How long until annos expire (<0 never) */
int lost_items_timeout = 172800; /* How long before removing from database */
double combat_mob = 5.0; /* how much mob do units spend for combat? */

View file

@ -58,8 +58,11 @@ delete_old_announcements(void)
char tmp_filename[1024];
int copy_file;
if (anno_keep_days < 0)
return;
time(&now);
old = now - days(ANNO_KEEP_DAYS);
old = now - days(anno_keep_days);
logerror("Deleting annos older than %s", ctime(&old));
if ((annfp = fopen(annfil, "rb")) == NULL) {