From bc0b9e1fa0523f770a012ca91c65ac64f835dfd8 Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 10 Apr 2021 18:15:43 -0700 Subject: [PATCH] Fix softlocks from turning off advancetext at wrong time When a text box in the script system (not the gamestate system) is displayed onscreen and "- Press ACTION to advance text -" is up, the game sets pausescript to true, so the script system won't blare past the text box and keep executing. Then it also sets advancetext to true. Crucially, these two variables are different, so if you have pausescript true but advancetext false, then what happens? Well, you get softlocked. There's no way to continue the script. How is this possible? Well, you can teleport to the (0,0) teleporter (the teleporter in the very top-left of the map) and regain control during the teleporter animation. To do that, in 2.2 and below, you have to press R at the same time you press Enter on the teleporter, or in 2.3 you can simply press R during the cutscene. Then once you teleport to the room, it's really precise and a bit difficult (especially if Viridian is invisible), but you can quickly walk over to the terminal in that room and press Enter on it. Then what will happen is the terminal script will run, but the teleporter gamestate sequence will finish and turn advancetext off in the middle of it. And then you're softlocked. To fix this, just add a check so if we're in gamestate 0 and there's a script running, but we have pausescript on and advancetext off, just turn pausescript off so the game automatically advances the script. This softlock was reported by Tzann on the VVVVVV speedrunning Discord. --- desktop_version/src/Game.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 0d5b89d9..3316d919 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -735,9 +735,17 @@ void Game::updatestate(void) case 0: //Do nothing here! Standard game state - //Prevent softlocks if there's no cutscene running right now - if (!script.running) + if (script.running) { + if (pausescript && !advancetext) + { + /* Prevent softlocks if we somehow don't have advancetext */ + pausescript = false; + } + } + else + { + /* Prevent softlocks if there's no cutscene running right now */ hascontrol = true; completestop = false; }