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

Glitchless: Fix line clipping

The reason that line clipping works is because when the gravity line
unflips the player, they are still eligible to flip (with
onground/onroof) so by doing it frame-perfectly they can flip again.

To fix this, just zero out their onground/onroof.

This glitch mainly applies to horizontal gravity lines but it is also
possible, but less severe (in most cases), with vertical gravity lines,
so this fixes it for vertical lines too.
This commit is contained in:
Misa 2024-08-30 11:47:41 -07:00
parent 3f222d3f74
commit 01d256b408

View file

@ -2783,6 +2783,14 @@ bool entityclass::updateentities( int i )
{
if (INBOUNDS_VEC(temp, entities) && entities[temp].vy > -3) entities[temp].vy = -3;
}
if (game.glitchlessmode && INBOUNDS_VEC(temp, entities))
{
/* Fix line clipping: Invalidate flipping eligibility so
* a second flip is impossible. */
entities[temp].onground = 0;
entities[temp].onroof = 0;
}
}
else if (entities[i].state == 2)
{
@ -4876,6 +4884,14 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/)
entities[j].state = entities[j].onentity;
entities[j].life = 6;
if (game.glitchlessmode)
{
/* Fix line clipping: Invalidate flipping eligibility so
* a second flip is impossible. */
entities[i].onground = 0;
entities[i].onroof = 0;
}
break;
}
case 5: //Person vs vertical gravity/warp line!