From 3aa407e98123f2ffb957c76e9786c894a6212371 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 2 Aug 2020 15:39:21 -0700 Subject: [PATCH] Add catch-all softlock protection What this simply does is make it so that in the event that game.hascontrol is somehow set to false when there isn't a cutscene running (i.e. when game.state is 0 and script.running is false), it gets set back to true again. There's many ways to interrupt a gamestate and/or a running script, most notably telejumping and doing a screen transition in the middle of the animation, interrupting it. This implements the first part of my idea in this comment: https://github.com/TerryCavanagh/VVVVVV/issues/391#issuecomment-659757071 --- desktop_version/src/Game.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index d0f52071..b8122b38 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -649,6 +649,12 @@ void Game::updatestate() { case 0: //Do nothing here! Standard game state + + //Prevent softlocks if there's no cutscene running right now + if (!script.running) + { + hascontrol = true; + } break; case 1: //Game initilisation