(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);
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)