mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Refactor: Unindent horizontal line code
This removes unnecessary indentation in the code responsible for acting on a horizontal gravity line collision. The "meat" of the code is now no longer pushed to the right, as it should be.
This commit is contained in:
parent
0edf0016d9
commit
265d4f9dc4
1 changed files with 23 additions and 21 deletions
|
@ -4852,30 +4852,32 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/)
|
|||
}
|
||||
break;
|
||||
case 4: //Person vs horizontal line!
|
||||
if(game.deathseq==-1)
|
||||
{
|
||||
const bool collision =
|
||||
game.deathseq == -1
|
||||
&& entities[j].onentity > 0
|
||||
&& entityhlinecollide(i, j);
|
||||
if (!collision)
|
||||
{
|
||||
if (entities[j].onentity > 0)
|
||||
{
|
||||
if (entityhlinecollide(i, j))
|
||||
{
|
||||
music.playef(Sound_GRAVITYLINE);
|
||||
game.gravitycontrol = (game.gravitycontrol + 1) % 2;
|
||||
game.totalflips++;
|
||||
if (game.gravitycontrol == 0)
|
||||
{
|
||||
if (entities[i].vy < 1) entities[i].vy = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (entities[i].vy > -1) entities[i].vy = -1;
|
||||
}
|
||||
|
||||
entities[j].state = entities[j].onentity;
|
||||
entities[j].life = 6;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
music.playef(Sound_GRAVITYLINE);
|
||||
game.gravitycontrol = (game.gravitycontrol + 1) % 2;
|
||||
game.totalflips++;
|
||||
if (game.gravitycontrol == 0)
|
||||
{
|
||||
if (entities[i].vy < 1) entities[i].vy = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (entities[i].vy > -1) entities[i].vy = -1;
|
||||
}
|
||||
|
||||
entities[j].state = entities[j].onentity;
|
||||
entities[j].life = 6;
|
||||
break;
|
||||
}
|
||||
case 5: //Person vs vertical gravity/warp line!
|
||||
if(game.deathseq==-1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue