From 634a41d80d38a98ad12d850f02e9425f3d1b928a Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 19 Nov 2020 15:16:54 -0800 Subject: [PATCH] Maintain game.swnmode until all gravitron squares are offscreen Today, I saw a video posted by Chelito on the VVVVVV speedrunning Discord where he died inside a gravitron square over and over after the Gravitron in Intermission 2 ended. https://cdn.discordapp.com/attachments/234787368522088448/779074864660480020/What.mp4 This is caused by the fact that after the Gravitron ends, the game no longer considers you to be inside swnmode, so it won't move the enemies offscreen when you die. To fix this, after the Gravitron ends, the game will switch to swngame 8, where it will keep you inside swnmode until all gravitron squares are offscreen. This means that gravitron squares that are onscreen after the Gravitron ends will be moved offscreen if you die, preventing the above death loop from happening. --- desktop_version/src/Logic.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index a82f90e3..bd5a199a 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -788,8 +788,7 @@ void gamelogic() if (obj.entities[line].xp > 320) { obj.removeentity(line); - game.swnmode = false; - game.swngame = 6; + game.swngame = 8; } } } @@ -810,6 +809,22 @@ void gamelogic() game.swncoldelay = 30; } } + else if (game.swngame == 8) //extra kludge if player dies after game a ends + { + bool square_onscreen = false; + for (size_t i = 0; i < obj.entities.size(); i++) + { + if (obj.entities[i].type == 23) + { + square_onscreen = true; + break; + } + } + if (!square_onscreen) + { + game.swnmode = false; + } + } } //Time trial stuff