/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* news.c: Show current Empire news
- *
+ *
* Known contributors to this file:
- *
+ *
*/
#include <config.h>
char num[128];
char *verb;
- if (!snxtitem(&nstr, EF_NEWS, "*"))
- return RET_SYN;
+ if (!snxtitem(&nstr, EF_NEWS, "*", NULL))
+ return RET_SYN;
memset(page_has_news, 0, sizeof(page_has_news));
memset(sectors_taken, 0, sizeof(sectors_taken));
(void)time(&now);
head();
pr("\nThe details of Empire news since %s", ctime(&then));
while (nxtitem(&nstr, &nws)) {
+ if (!nws.nws_vrb || CANT_HAPPEN(nws.nws_vrb > N_MAX_VERB))
+ continue;
if (nws.nws_when < then)
continue;
if (opt_HIDDEN) {
pr("\n\t === %s ===\n", page_headings[page].name);
snxtitem_rewind(&nstr);
while (nxtitem(&nstr, &nws)) {
+ if (CANT_HAPPEN(nws.nws_vrb > N_MAX_VERB))
+ continue;
if (rpt[(int)nws.nws_vrb].r_newspage != page)
continue;
if (nws.nws_when < then)
strcpy(cp, cname(np->nws_ano));
cp += strlen(cp);
*cp++ = ' ';
- if (np->nws_vrb < 1 || np->nws_vrb > N_MAX_VERB)
- np->nws_vrb = 0;
sprintf(cp, rpt[(int)np->nws_vrb].r_newstory[random() % NUM_RPTS],
cname(np->nws_vno));
cp += strlen(cp);
sprintf(cp, " %s times", ptr);
cp += strlen(cp);
}
- if (*buf >= 'a' && *buf <= 'z')
- *buf += 'A' - 'a';
if (cp - buf > 80) {
for (i = 80; --i > 60;)
if (buf[i] == ' ')