(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.
This commit is contained in:
Markus Armbruster 2006-01-05 16:22:43 +00:00
parent c6979cb0e0
commit f6987ca3ef

View file

@ -75,21 +75,20 @@ news(void)
(void)time(&now); (void)time(&now);
natp = getnatp(player->cnum); natp = getnatp(player->cnum);
then = natp->nat_newstim; then = natp->nat_newstim;
/* if (player->argp[1]) {
* Don't disclose events before contact. Proper solution would be /*
* to timestamp the contact. Cheesy approximatation: disable old * We want to hide events before contact. Proper solution
* news. * would be to timestamp the contact. Cheesy approximation:
*/ * disable old news.
if (!opt_HIDDEN) { */
if (player->argp[1] != 0 && isdigit(*player->argp[1])) { if (opt_HIDDEN && !player->god) {
delta = days(atoi(player->argp[1])); pr("Sorry, argument doesn't work with HIDDEN enabled\n");
then = now - delta; return RET_FAIL;
} }
delta = days(atoi(player->argp[1]));
then = now - delta;
} }
natp->nat_newstim = now; natp->nat_newstim = now;
/* if (then < now - days(3))
then = now - days(3);
*/
pr("\nThe details of Empire news since %s", ctime(&then)); pr("\nThe details of Empire news since %s", ctime(&then));
while (nxtitem(&nstr, &nws)) { while (nxtitem(&nstr, &nws)) {
if (nws.nws_when < then) if (nws.nws_when < then)