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

Fix the flipgravity() internal command (#78)

There are two main problems with flipgravity():
 1. It doesn't work for an already-flipped crewmate.
 2. It doesn't work on the player.

This commit addresses both of those issues.
This commit is contained in:
Info Teddy 2020-01-14 05:51:33 -08:00 committed by Ethan Lee
parent 6a0ee21082
commit 10ed0058fd

View file

@ -927,9 +927,11 @@ void scriptclass::run( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map,
//not something I'll use a lot, I think. Doesn't need to be very robust! //not something I'll use a lot, I think. Doesn't need to be very robust!
if (words[1] == "player") if (words[1] == "player")
{ {
i=obj.getplayer(); game.gravitycontrol = !game.gravitycontrol;
} }
else if (words[1] == "cyan") else
{
if (words[1] == "cyan")
{ {
i=obj.getcrewman(0); i=obj.getcrewman(0);
} }
@ -954,9 +956,18 @@ void scriptclass::run( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map,
i=obj.getcrewman(1); i=obj.getcrewman(1);
} }
if (obj.entities[i].rule == 6)
{
obj.entities[i].rule = 7; obj.entities[i].rule = 7;
obj.entities[i].tile = 6; obj.entities[i].tile = 6;
} }
else if (obj.entities[i].rule == 7)
{
obj.entities[i].rule = 6;
obj.entities[i].tile = 0;
}
}
}
else if (words[0] == "changegravity") else if (words[0] == "changegravity")
{ {
//not something I'll use a lot, I think. Doesn't need to be very robust! //not something I'll use a lot, I think. Doesn't need to be very robust!