1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01: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 has_control = false;
bool enter_pressed = game.press_map && !game.mapheld; bool enter_pressed = game.press_map && !game.mapheld;
bool enter_already_processed = false; bool enter_already_processed = false;
bool any_onground = false;
bool any_onroof = false;
bool interact_pressed; bool interact_pressed;
if (game.separate_interact) if (game.separate_interact)
{ {
@ -2179,6 +2181,12 @@ void gameinput(void)
obj.entities[ie].dir = 1; 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) if (game.jumppressed > 0)
{ {
game.jumppressed--; game.jumppressed--;
if (obj.entities[obj.getplayer()].onground>0 && game.gravitycontrol == 0) if (any_onground && game.gravitycontrol == 0)
{ {
game.gravitycontrol = 1; game.gravitycontrol = 1;
for (size_t ie = 0; ie < obj.entities.size(); ++ie) for (size_t ie = 0; ie < obj.entities.size(); ++ie)
@ -2255,7 +2263,7 @@ void gameinput(void)
game.jumppressed = 0; game.jumppressed = 0;
game.totalflips++; game.totalflips++;
} }
if (obj.entities[obj.getplayer()].onroof>0 && game.gravitycontrol == 1) if (any_onroof && game.gravitycontrol == 1)
{ {
game.gravitycontrol = 0; game.gravitycontrol = 0;
for (size_t ie = 0; ie < obj.entities.size(); ++ie) for (size_t ie = 0; ie < obj.entities.size(); ++ie)