1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-01 10:33:32 +02:00

Allow any player entity to be on the ground/roof to flip

This re-adds the midair flip glitch.
This commit is contained in:
leo60228 2020-09-23 05:31:06 -04:00 committed by Misa Elizabeth Kai
parent 1e8b5a6ba7
commit 52fceb3f69

View File

@ -2063,6 +2063,8 @@ void gameinput(void)
bool has_control = false;
bool enter_pressed = game.press_map && !game.mapheld;
bool enter_already_processed = false;
bool any_onground = false;
bool any_onroof = false;
bool interact_pressed;
if (game.separate_interact)
{
@ -2179,6 +2181,12 @@ void gameinput(void)
obj.entities[ie].dir = 1;
}
}
if (obj.entities[ie].onground > 0) {
any_onground = true;
} else if (obj.entities[ie].onroof > 0) {
any_onroof = true;
}
}
}
@ -2240,7 +2248,7 @@ void gameinput(void)
if (game.jumppressed > 0)
{
game.jumppressed--;
if (obj.entities[obj.getplayer()].onground>0 && game.gravitycontrol == 0)
if (any_onground && game.gravitycontrol == 0)
{
game.gravitycontrol = 1;
for (size_t ie = 0; ie < obj.entities.size(); ++ie)
@ -2255,7 +2263,7 @@ void gameinput(void)
game.jumppressed = 0;
game.totalflips++;
}
if (obj.entities[obj.getplayer()].onroof>0 && game.gravitycontrol == 1)
if (any_onroof && game.gravitycontrol == 1)
{
game.gravitycontrol = 0;
for (size_t ie = 0; ie < obj.entities.size(); ++ie)