EMPCF_COMMENT("\n\n### Misc.")
EMPCFBOTH("anno_keep_days", anno_keep_days, int, NSC_INT, KM_INTERNAL,
"How long until announcements expire (<0 means never)")
+EMPCFBOTH("news_keep_days", news_keep_days, int, NSC_INT, KM_INTERNAL,
+ "How long until news expire")
EMPCFBOTH("fuel_mult", fuel_mult, int, NSC_INT, 0,
"Multiplier for fuel to mobility calculation")
EMPCFBOTH("lost_items_timeout", lost_items_timeout, int, NSC_INT, KM_INTERNAL,
a sector has after being taken */
int anno_keep_days = 7; /* How long until annos expire (<0 never) */
+int news_keep_days = 10; /* How long until news 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? */
#include "file.h"
#include "empio.h"
#include <fcntl.h>
+#include "optlist.h"
#include "prototypes.h"
static void filereport(int, int, int, int);
static void
findfree(void)
{
- register time_t oldnewstime;
- register int n;
+ time_t oldnewstime;
+ int n;
struct nwsstr news;
- time_t newstime;
- (void)time(&newstime);
- oldnewstime = newstime - NEWS_PERIOD;
+ oldnewstime = time(NULL) - days(news_keep_days);
for (n = 0; getnews(n, &news); n++) {
if (news.nws_when < oldnewstime)
addfree(n);