From ac78f83d4373d7e3b5f3673f9bbd30c661135cbc Mon Sep 17 00:00:00 2001 From: Steve Date: Thu, 5 May 2016 12:47:19 +0100 Subject: [PATCH] Avoid speaking the same wingmate twice, if possible. --- src/battle/messageBox.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/battle/messageBox.c b/src/battle/messageBox.c index 1cfff88..7fbd4bf 100644 --- a/src/battle/messageBox.c +++ b/src/battle/messageBox.c @@ -25,11 +25,14 @@ static void nextMessage(void); static MessageBox head; static MessageBox *tail; +static Entity *lastWingmate; void initMessageBox(void) { memset(&head, 0, sizeof(MessageBox)); tail = &head; + + lastWingmate = NULL; } void addMessageBox(char *title, char *body, int important) @@ -170,9 +173,9 @@ static void nextMessage(void) { wingmate = e; - if (rand() % 2) + if (rand() % 2 && e != lastWingmate) { - battle.messageSpeaker = e; + battle.messageSpeaker = lastWingmate = e; return; } }