1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49: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:
Misa 2024-08-30 11:23:55 -07:00
parent 0edf0016d9
commit 265d4f9dc4

View file

@ -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)
{