/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
*
* ---
*
- * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- * related information and legal notices. It is expected that any future
- * projects/authors will amend these files as needed.
+ * See files README, COPYING and CREDITS in the root of the source
+ * tree for related information and legal notices. It is expected
+ * that future projects/authors will amend these files as needed.
*
* ---
*
*
*/
+#include <config.h>
+
#include "misc.h"
#include "player.h"
#include "nat.h"
s_char num[128];
s_char *verb;
+ if (!snxtitem(&nstr, EF_NEWS, "*"))
+ return RET_SYN;
memset(page_has_news, 0, sizeof(page_has_news));
memset(sectors_taken, 0, sizeof(sectors_taken));
(void)head();
(void)time(&now);
natp = getnatp(player->cnum);
then = natp->nat_newstim;
- /*
- * Don't disclose events before contact. Proper solution would be
- * to timestamp the contact. Cheesy approximatation: disable old
- * news.
- */
- if (!opt_HIDDEN) {
- if (player->argp[1] != 0 && isdigit(*player->argp[1])) {
- delta = days(atoi(player->argp[1]));
- then = now - delta;
+ if (player->argp[1]) {
+ /*
+ * We want to hide events before contact. Proper solution
+ * would be to timestamp the contact. Cheesy approximation:
+ * disable old news.
+ */
+ if (opt_HIDDEN && !player->god) {
+ pr("Sorry, argument doesn't work with HIDDEN enabled\n");
+ return RET_FAIL;
}
+ delta = days(atoi(player->argp[1]));
+ then = now - delta;
}
natp->nat_newstim = now;
-/* if (then < now - days(3))
- then = now - days(3);
-*/
- snxtitem(&nstr, EF_NEWS, "*");
pr("\nThe details of Empire news since %s", ctime(&then));
- while (nxtitem(&nstr, (s_char *)&nws)) {
+ while (nxtitem(&nstr, &nws)) {
if (nws.nws_when < then)
continue;
if (opt_HIDDEN) {
continue;
pr("\n\t === %s ===\n", page_headings[page]);
snxtitem_rewind(&nstr);
- while (nxtitem(&nstr, (s_char *)&nws)) {
+ while (nxtitem(&nstr, &nws)) {
if (rpt[(int)nws.nws_vrb].r_newspage != page)
continue;
if (nws.nws_when < then)