1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Condense some nested else-if statements

It's better to write 'else if' than 'else { if }'.
This commit is contained in:
Misa 2020-04-04 12:19:18 -07:00 committed by Ethan Lee
parent e6c6c7cf60
commit 7899cb8088

View file

@ -1044,12 +1044,9 @@ void gamelogic()
{ {
obj.entities[i].xp += 320; obj.entities[i].xp += 320;
} }
else else if (obj.entities[i].xp > 310)
{ {
if (obj.entities[i].xp > 310) obj.entities[i].xp -= 320;
{
obj.entities[i].xp -= 320;
}
} }
} }
} }
@ -1064,12 +1061,9 @@ void gamelogic()
{ {
obj.entities[i].yp += 232; obj.entities[i].yp += 232;
} }
else else if (obj.entities[i].yp > 226)
{ {
if (obj.entities[i].yp > 226) obj.entities[i].yp -= 232;
{
obj.entities[i].yp -= 232;
}
} }
} }
} }
@ -1088,12 +1082,9 @@ void gamelogic()
{ {
obj.entities[i].xp += 400; obj.entities[i].xp += 400;
} }
else else if (obj.entities[i].xp > 320)
{ {
if (obj.entities[i].xp > 320) obj.entities[i].xp -= 400;
{
obj.entities[i].xp -= 400;
}
} }
} }
else else
@ -1102,12 +1093,9 @@ void gamelogic()
{ {
obj.entities[i].xp += 320; obj.entities[i].xp += 320;
} }
else else if (obj.entities[i].xp > 310)
{ {
if (obj.entities[i].xp > 310) obj.entities[i].xp -= 320;
{
obj.entities[i].xp -= 320;
}
} }
} }
} }
@ -1134,12 +1122,9 @@ void gamelogic()
{ {
obj.entities[i].yp += 232; obj.entities[i].yp += 232;
} }
else else if (obj.entities[i].yp > 226)
{ {
if (obj.entities[i].yp > 226) obj.entities[i].yp -= 232;
{
obj.entities[i].yp -= 232;
}
} }
} }
} }
@ -1154,12 +1139,9 @@ void gamelogic()
{ {
obj.entities[i].xp += 350; obj.entities[i].xp += 350;
} }
else else if (obj.entities[i].xp > 320)
{ {
if (obj.entities[i].xp > 320) obj.entities[i].xp -= 350;
{
obj.entities[i].xp -= 350;
}
} }
} }
} }