diff --git a/include/empobj.h b/include/empobj.h index 713f2f4a..373ec021 100644 --- a/include/empobj.h +++ b/include/empobj.h @@ -84,7 +84,6 @@ union empobj_storage { struct lonstr loan; struct loststr lost; struct natstr nat; - struct nwsstr news; struct nukstr nuke; struct plnstr plane; struct realmstr realm; diff --git a/include/news.h b/include/news.h index 54d7ef9f..b6853a99 100644 --- a/include/news.h +++ b/include/news.h @@ -45,12 +45,6 @@ #include "nsc.h" struct nwsstr { - /* initial part must match struct empobj */ - short ef_type; - short nws_uid; - unsigned nws_seqno; - time_t nws_timestamp; - /* end of part matching struct empobj */ natid nws_ano; /* "actor" country # */ unsigned char nws_vrb; /* action (verb) */ natid nws_vno; /* "victim" country # */ diff --git a/info/xdump.t b/info/xdump.t index 95ab1600..4521c712 100644 --- a/info/xdump.t +++ b/info/xdump.t @@ -97,6 +97,8 @@ yet available in human-readable form: the lost file, sect-chr selector nav, ship and land plague status (deity only), plane theta (governs satellite movement), trade selectors xloc, yloc, commodity selectors xbuy, ybuy. +Incremental dump doesn't work after importing news with the empdump +utility. .s1 .L "FUTURE DIRECTIONS:" xdump is still fairly new, and experience with it may lead to changes. diff --git a/src/lib/common/filetable.c b/src/lib/common/filetable.c index 100c3f47..8bfb1bbf 100644 --- a/src/lib/common/filetable.c +++ b/src/lib/common/filetable.c @@ -133,7 +133,7 @@ struct empfile empfile[] = { {EF_NUKE, "nuke", "nuke", nuke_ca, UNMAPPED_CACHE(struct nukstr, EFF_TYPED | EFF_XY | EFF_OWNER)}, {EF_NEWS, "news", "news", news_ca, - UNMAPPED_CACHE(struct nwsstr, EFF_TYPED)}, + UNMAPPED_CACHE(struct nwsstr, 0)}, {EF_TREATY, "treaty", "treaty", treaty_ca, UNMAPPED_CACHE(struct trtstr, EFF_TYPED)}, {EF_TRADE, "trade", "trade", trade_ca, diff --git a/src/lib/common/nsc.c b/src/lib/common/nsc.c index eb0348ee..c237b5e0 100644 --- a/src/lib/common/nsc.c +++ b/src/lib/common/nsc.c @@ -67,6 +67,7 @@ static void *nsc_lnd_acc(struct valstr *, struct natstr *, void *); static void *nsc_lnd_dam(struct valstr *, struct natstr *, void *); static void *nsc_lnd_aaf(struct valstr *, struct natstr *, void *); static void *nsc_lchr(struct valstr *, struct natstr *, void *); +static void *nsc_nws_timestamp(struct valstr *, struct natstr *, void *); /* Ugly hack to improve legibility by avoid long lines */ #define fldoff(fld) offsetof(CURSTR, fld) @@ -468,9 +469,7 @@ struct castr loan_ca[] = { struct castr news_ca[] = { #define CURSTR struct nwsstr - /* no need for uid as long as it's not referenced from other tables */ - {"timestamp", fldoff(nws_timestamp), NSC_TIME, 0, NULL, - EF_BAD, NSC_EXTRA}, + {"timestamp", 0, NSC_LONG, 0, nsc_nws_timestamp, EF_BAD, NSC_EXTRA}, {"actor", fldoff(nws_ano), NSC_NATID, 0, NULL, EF_NATION, 0}, {"action", fldoff(nws_vrb), NSC_UCHAR, 0, NULL, EF_NEWS_CHR, 0}, {"victim", fldoff(nws_vno), NSC_NATID, 0, NULL, EF_NATION, 0}, @@ -915,3 +914,12 @@ nsc_lchr(struct valstr *val, struct natstr *np, void *ptr) val->val_as.sym.get = NULL; return lchr + ((struct lndstr *)ptr)->lnd_type; } + +static void * +nsc_nws_timestamp(struct valstr *val, struct natstr *natp, void *ptr) +{ + struct nwsstr *np = ptr; + + val->val_as.lng = np->nws_when + np->nws_duration; + return NULL; +} diff --git a/src/lib/subs/nreport.c b/src/lib/subs/nreport.c index 2d92aa8a..cfb5641b 100644 --- a/src/lib/subs/nreport.c +++ b/src/lib/subs/nreport.c @@ -117,7 +117,6 @@ delete_old_news(void) for (j = 0; getnews(i + j, &news); j++) { if (news.nws_vrb == 0) break; - ef_set_uid(EF_NEWS, &news, j); putnews(j, &news); } CANT_HAPPEN(i + j != news_tail);