(NEWS_PERIOD, news_keep_days): Replace macro NEWS_PERIOD by new
configuration key news_keep_days.
This commit is contained in:
parent
2dd13e096d
commit
3dc73b39d2
4 changed files with 7 additions and 7 deletions
|
@ -82,6 +82,7 @@ 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 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? */
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "file.h"
|
||||
#include "empio.h"
|
||||
#include <fcntl.h>
|
||||
#include "optlist.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
static void filereport(int, int, int, int);
|
||||
|
@ -105,13 +106,11 @@ addfree(int n)
|
|||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue