mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Condense some nested else-if statements
It's better to write 'else if' than 'else { if }'.
This commit is contained in:
parent
e6c6c7cf60
commit
7899cb8088
1 changed files with 12 additions and 30 deletions
|
@ -1044,12 +1044,9 @@ void gamelogic()
|
|||
{
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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
|
||||
|
@ -1102,12 +1093,9 @@ void gamelogic()
|
|||
{
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
else
|
||||
else if (obj.entities[i].xp > 320)
|
||||
{
|
||||
if (obj.entities[i].xp > 320)
|
||||
{
|
||||
obj.entities[i].xp -= 350;
|
||||
}
|
||||
obj.entities[i].xp -= 350;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue