Don't use strcmp each time.
This commit is contained in:
parent
fcbf18116c
commit
1e04aea417
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue