From b83cab85772f581cd5d2fd4bd8f0ad22a2da40c3 Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 7 May 2020 15:36:38 -0700 Subject: [PATCH] Directly do returntolab code instead of relying on a script Having to rely on a script means the fade out wouldn't be self-contained in MAPMODE, which could cause a small issue where you could die during the return to the lab. But that issue is now fixed. There's no need to use the script, and anyway the endcutscene() and untilbars() in said script don't do anything because there are no cutscene bars in the first place, so no need to worry about those. --- desktop_version/src/Game.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index eb112865..b979d6bb 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -7361,6 +7361,25 @@ void Game::returntolab() { gamestate = GAMEMODE; graphics.fademode = 4; - startscript = true; - newscript="returntolab"; + map.gotoroom(119, 107); + int player = obj.getplayer(); + if (player > -1) + { + obj.entities[player].xp = 132; + obj.entities[player].yp = 137; + } + gravitycontrol = 0; + + savepoint = 0; + saverx = 119; + savery = 107; + savex = 132; + savey = 137; + savegc = 0; + if (player > -1) + { + savedir = obj.entities[player].dir; + } + + music.play(11); }