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

Correct onground/onroof check

This commit is contained in:
leo60228 2021-09-02 18:30:30 -04:00 committed by Misa Elizabeth Kai
parent 72ade2ce49
commit d64608ecaa

View file

@ -2260,7 +2260,7 @@ void gameinput(void)
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)
{ {
if (obj.entities[ie].rule == 0 && obj.entities[ie].onground) if (obj.entities[ie].rule == 0 && (obj.entities[ie].onground > 0 || obj.entities[ie].onroof > 0))
{ {
obj.entities[ie].vy = -4; obj.entities[ie].vy = -4;
obj.entities[ie].ay = -3; obj.entities[ie].ay = -3;
@ -2275,7 +2275,7 @@ void gameinput(void)
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)
{ {
if (obj.entities[ie].rule == 0 && obj.entities[ie].onroof) if (obj.entities[ie].rule == 0 && (obj.entities[ie].onground > 0 || obj.entities[ie].onroof > 0))
{ {
obj.entities[ie].vy = 4; obj.entities[ie].vy = 4;
obj.entities[ie].ay = 3; obj.entities[ie].ay = 3;