(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:
parent
c6979cb0e0
commit
f6987ca3ef
1 changed files with 11 additions and 12 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue