From 1e04aea41766ac91e8a978a623f69c1db6c01c7b Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 4 May 2016 16:23:49 +0100 Subject: [PATCH] Don't use strcmp each time. --- src/battle/messageBox.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/battle/messageBox.c b/src/battle/messageBox.c index 10f029f..1cfff88 100644 --- a/src/battle/messageBox.c +++ b/src/battle/messageBox.c @@ -148,9 +148,12 @@ void drawMessageBox(void) static void nextMessage(void) { Entity *e, *wingmate; + int isWingmate; wingmate = NULL; + isWingmate = strcmp(head.next->title, "Wingmate") == 0; + playSound(SND_RADIO); for (e = battle.entityHead.next ; e != NULL ; e = e->next) @@ -163,7 +166,7 @@ static void nextMessage(void) return; } - if (strcmp(head.next->title, "Wingmate") == 0 && e->type == ET_FIGHTER && e->speed > 0) + if (isWingmate && e->type == ET_FIGHTER && e->speed > 0) { wingmate = e;