From 15319b9ed01134d053dede26b4e05607f6518675 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 10 Jul 2020 16:30:28 -0700 Subject: [PATCH] Fix being able to circumvent not-in-Flip-Mode detection So you get a trophy and achievement for completing the game in Flip Mode. Which begs the question, how does the game know that you've played through the game in Flip Mode the entire way, and haven't switched it off at any point? It looks like if you play normally all the way up until the checkpoint in V, and then turn on Flip Mode, the game won't give you the trophy. What gives? Well, actually, what happens is that every time you press Enter on a teleporter, the game will set flag 73 to true if you're NOT in Flip Mode. Then when Game Complete runs, the game will check if flag 73 is off, and then give you the achievement and trophy accordingly. However, what this means is that you could just save your game before pressing Enter on a teleporter, then quit and go into options, turn on Flip Mode, use the teleporter, then save your game (it's automatically saved since you just used a teleporter), quit and go into options, and turn it off. Then you'd get the Flip Mode trophy even though you haven't actually played the entire game in Flip Mode. Furthermore, in 2.3 you can bring up the pause menu to toggle Flip Mode, so you don't even have to quit to circumvent this detection. To fix both of these exploits, I moved the turning on of flag 73 to starting a new game, loading a quicksave, and loading a telesave (cases 0, 1, and 2 respectively in scriptclass::startgamemode()). I also added a Flip Mode check to the routine that runs whenever you exit an options menu back to the pause menu, so you can't circumvent the detection that way, either. --- desktop_version/src/Game.cpp | 4 ++++ desktop_version/src/Input.cpp | 4 ---- desktop_version/src/Script.cpp | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index e464dd3b..14eb272a 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -7313,5 +7313,9 @@ void Game::returntopausemenu() graphics.backgrounddrawn = false; game.mapheld = true; graphics.flipmode = graphics.setflipmode; + if (!map.custommode && !graphics.flipmode) + { + obj.flags[73] = true; + } game.shouldreturntopausemenu = true; } diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index f0fc6db0..38936550 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -1741,10 +1741,6 @@ void gameinput() if (game.activetele && game.readytotele > 20 && !game.intimetrial) { - if(!graphics.flipmode) - { - obj.flags[73] = true; //Flip mode test - } if(int(std::abs(obj.entities[ie].vx))<=1 && int(obj.entities[ie].vy)==0) { //wait! space station 2 debug thingy diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index bc392a61..538b983b 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -2633,6 +2633,7 @@ void scriptclass::startgamemode( int t ) //set flipmode if (graphics.setflipmode) graphics.flipmode = true; + else obj.flags[73] = true; if(obj.entities.empty()) { @@ -2657,6 +2658,7 @@ void scriptclass::startgamemode( int t ) //set flipmode if (graphics.setflipmode) graphics.flipmode = true; + else obj.flags[73] = true; if(obj.entities.empty()) { @@ -2680,6 +2682,7 @@ void scriptclass::startgamemode( int t ) //set flipmode if (graphics.setflipmode) graphics.flipmode = true; + else obj.flags[73] = true; if(obj.entities.empty()) {