Don't use strcmp each time.

This commit is contained in:
Steve 2016-05-04 16:23:49 +01:00
parent fcbf18116c
commit 1e04aea417
1 changed files with 4 additions and 1 deletions

View File

@ -148,9 +148,12 @@ void drawMessageBox(void)
static void nextMessage(void) static void nextMessage(void)
{ {
Entity *e, *wingmate; Entity *e, *wingmate;
int isWingmate;
wingmate = NULL; wingmate = NULL;
isWingmate = strcmp(head.next->title, "Wingmate") == 0;
playSound(SND_RADIO); playSound(SND_RADIO);
for (e = battle.entityHead.next ; e != NULL ; e = e->next) for (e = battle.entityHead.next ; e != NULL ; e = e->next)
@ -163,7 +166,7 @@ static void nextMessage(void)
return; 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; wingmate = e;