From 671e976ad6f0faeced57635519f6eb75e4d7ce44 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 19 May 2012 16:54:41 -0700 Subject: [PATCH] Nobody needs to see empty messages in the CR --- src/gamecode/creport.c | 4 ++-- src/kernel/message.h | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gamecode/creport.c b/src/gamecode/creport.c index 8c63cd9e3..189645ffd 100644 --- a/src/gamecode/creport.c +++ b/src/gamecode/creport.c @@ -522,10 +522,10 @@ static void render_messages(FILE * F, faction * f, message_list * msgs) #endif crbuffer[0] = '\0'; if (cr_render(m->msg, crbuffer, (const void *)f) == 0) { - if (!printed) + if (crbuffer[0] && !printed) { fprintf(F, "MESSAGE %u\n", messagehash(m->msg)); - if (crbuffer[0]) fputs(crbuffer, F); + } } else { log_error("could not render cr-message %p: %s\n", m->msg, m->msg->type->name); } diff --git a/src/kernel/message.h b/src/kernel/message.h index 2623df169..e860bd996 100644 --- a/src/kernel/message.h +++ b/src/kernel/message.h @@ -30,11 +30,13 @@ extern "C" { struct message_type; + typedef struct mlist { + struct mlist *next; + struct message *msg; + }; + typedef struct message_list { - struct mlist { - struct mlist *next; - struct message *msg; - } *begin, **end; + struct mlist *begin, **end; } message_list; extern void free_messagelist(message_list * msgs);