From b575761264b10eb3002080d1a0615f53d3e2fd44 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 20 May 2001 10:44:37 +0000 Subject: [PATCH] receiver in messages wieder rueckgaengig (reports) --- src/common/gamecode/creport.c | 60 +++++++++++++++++------------------ src/common/gamecode/report.c | 3 +- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index b5f7fd09a..a328d9a69 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -379,39 +379,37 @@ render_messages(FILE * F, faction * f, message_list *msgs) { struct mlist* m = msgs->begin; while (m) { - if(m->msg->receiver == NULL || m->msg->receiver == f) { - char crbuffer[1024*32]; /* gross, wegen spionage-messages :-( */ - boolean printed = false; - const struct message_type * mtype = m->msg->type; - unsigned int hash = hashstring(mtype->name); + char crbuffer[1024*32]; /* gross, wegen spionage-messages :-( */ + boolean printed = false; + const struct message_type * mtype = m->msg->type; + unsigned int hash = hashstring(mtype->name); #if RENDER_CRMESSAGES - char nrbuffer[1024*32]; - nrbuffer[0] = '\0'; - if (nr_render(m->msg, f->locale, nrbuffer, f)==0 && nrbuffer[0]) { - fprintf(F, "MESSAGE %d\n", ++msgno); - fprintf(F, "%d;type\n", hash); - fputs("\"", F); - fputs(nrbuffer, F); - fputs("\";rendered\n", F); - printed = true; - } + char nrbuffer[1024*32]; + nrbuffer[0] = '\0'; + if (nr_render(m->msg, f->locale, nrbuffer, f)==0 && nrbuffer[0]) { + fprintf(F, "MESSAGE %d\n", ++msgno); + fprintf(F, "%d;type\n", hash); + fputs("\"", F); + fputs(nrbuffer, F); + fputs("\";rendered\n", F); + printed = true; + } #endif - crbuffer[0] = '\0'; - if (cr_render(m->msg, crbuffer, (const void*)f)==0 && crbuffer[0]) { - if (!printed) fprintf(F, "MESSAGE %d\n", ++msgno); - fputs(crbuffer, F); - } - else log_error(("could not render cr-message %p\n", m->msg)); - if (printed) { - unsigned int ihash = hash % MTMAXHASH; - struct known_mtype * kmt = mtypehash[ihash]; - while (kmt && kmt->mtype != mtype) kmt = kmt->nexthash; - if (kmt==NULL) { - kmt = (struct known_mtype*)malloc(sizeof(struct known_mtype)); - kmt->nexthash = mtypehash[ihash]; - kmt->mtype = mtype; - mtypehash[ihash] = kmt; - } + crbuffer[0] = '\0'; + if (cr_render(m->msg, crbuffer, (const void*)f)==0 && crbuffer[0]) { + if (!printed) fprintf(F, "MESSAGE %d\n", ++msgno); + fputs(crbuffer, F); + } + else log_error(("could not render cr-message %p\n", m->msg)); + if (printed) { + unsigned int ihash = hash % MTMAXHASH; + struct known_mtype * kmt = mtypehash[ihash]; + while (kmt && kmt->mtype != mtype) kmt = kmt->nexthash; + if (kmt==NULL) { + kmt = (struct known_mtype*)malloc(sizeof(struct known_mtype)); + kmt->nexthash = mtypehash[ihash]; + kmt->mtype = mtype; + mtypehash[ihash] = kmt; } } m = m->next; diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 4147e9ccb..6d9efb44b 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -752,8 +752,7 @@ rp_messages(FILE * F, message_list * msgs, faction * viewer, int indent, boolean if (!debug && get_msglevel(viewer->warnings, viewer->msglevels, m->type) < m->level) continue; #endif /* messagetype * mt = m->type; */ - if (strcmp(nr_section(m->msg), category->name)==0 - && (m->msg->receiver == NULL || m->msg->receiver == viewer)) + if (strcmp(nr_section(m->msg), category->name)==0) { char buf[4096], *s = buf; nr_render(m->msg, viewer->locale, s, viewer);