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

Fix flipgravity() rule conversion being inverted

In 2.0, 2.1, and 2.2, calling flipgravity() on an entity that wasn't
rule 6 would change it to rule 7. In 2.3 currently, doing this will only
change it to rule 7 if it's already rule 6, starting with the
introduction of the change where if an entity was rule 7 it would be
changed to rule 6.

The crewmate conversion trick has been restored, but converting an
entity to a crewmate will change its rule to 6, not 7 like in pre-2.3.
If you want it to be changed to rule 7 instead of 6, you'd have to call
flipgravity() twice in 2.3 and only once in pre-2.3, which would make
maintaining compatibility between versions a bit harder.

So to fix this, I'm inverting it so that if you call flipgravity() on an
entity that isn't rule 7, it will be converted to rule 7, and only if
it's rule 7 will it be converted to rule 6.
This commit is contained in:
Misa 2020-09-23 23:40:16 -07:00 committed by Ethan Lee
parent 5b9a8e5f08
commit d1fd910bdb

View file

@ -1001,16 +1001,16 @@ void scriptclass::run()
i=obj.getcrewman(1);
}
if (obj.entities[i].rule == 6)
{
obj.entities[i].rule = 7;
obj.entities[i].tile = 6;
}
else if (obj.getplayer() != i) // Don't destroy player entity
if (obj.entities[i].rule == 7)
{
obj.entities[i].rule = 6;
obj.entities[i].tile = 0;
}
else if (obj.getplayer() != i) // Don't destroy player entity
{
obj.entities[i].rule = 7;
obj.entities[i].tile = 6;
}
}
}
else if (words[0] == "changegravity")