From d1fd910bdbd0b6369becbd38c9917599416824c3 Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 23 Sep 2020 23:40:16 -0700 Subject: [PATCH] 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. --- desktop_version/src/Script.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index f4fc3a1a..e016661a 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -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")