short nws_uid;
/* end of part matching struct empobj */
natid nws_ano; /* "actor" country # */
- signed char nws_vrb; /* action (verb) */
+ unsigned char nws_vrb; /* action (verb) */
natid nws_vno; /* "victim" country # */
signed char nws_ntm; /* number of times */
time_t nws_when; /* time of action */
snxtitem_all(&nstr, EF_NEWS);
maxcnum = 0;
while (nxtitem(&nstr, &news)) {
+ if (!news.nws_vrb || CANT_HAPPEN(news.nws_vrb > N_MAX_VERB))
+ continue;
news_age = now - news.nws_when;
if (news_age > news_per)
continue;
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);
struct castr news_ca[] = {
/* no need for uid as long as it's not referenced from other tables */
{NSC_NATID, 0, 0, fldoff(nwsstr, nws_ano), "actor", EF_NATION},
- {NSC_CHAR, 0, 0, fldoff(nwsstr, nws_vrb), "action", EF_NEWS_CHR},
+ {NSC_UCHAR, 0, 0, fldoff(nwsstr, nws_vrb), "action", EF_NEWS_CHR},
{NSC_NATID, 0, 0, fldoff(nwsstr, nws_vno), "victim", EF_NATION},
{NSC_CHAR, 0, 0, fldoff(nwsstr, nws_ntm), "times", EF_BAD},
{NSC_TIME, 0, 0, fldoff(nwsstr, nws_when), "time", EF_BAD},