From f6987ca3efd4ff0015faed8ca465e2d288437359 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 5 Jan 2006 16:22:43 +0000 Subject: [PATCH] (news): Used to silently ignore argument when HIDDEN is enabled. Complain and fail instead. (news): Treat non-numeric argument like zero, not like no argument, for consistency with other commands. --- src/lib/commands/news.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/lib/commands/news.c b/src/lib/commands/news.c index e4629906..7468c8f9 100644 --- a/src/lib/commands/news.c +++ b/src/lib/commands/news.c @@ -75,21 +75,20 @@ news(void) (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); -*/ pr("\nThe details of Empire news since %s", ctime(&then)); while (nxtitem(&nstr, &nws)) { if (nws.nws_when < then)