From 37a1482bb32637e87e560586cbcda496eee401ec Mon Sep 17 00:00:00 2001 From: Info Teddy Date: Wed, 15 Jan 2020 18:10:39 -0800 Subject: [PATCH] Fix warpdir() doing wrong BG with warp dir 0 in current room If you're in the room being targeted when a `warpdir()` command is run, and it sets the warp direction to none (warp dir 0), and if you're in a Lab or Warp Zone room, the background will be set to the wrong one, because it will always set the background to the stars-going-left background, instead of setting it to the Lab background or the stars-going-up background. However, this is only a visual glitch, and is a temporary one, because if you manage to trigger a `gotoroom()` on the room, it will get set to its proper background. This commit makes it so if you're in a Lab room, the background gets set to the Lab background, and if you're in a Warp Zone room, the background gets set to the stars-going-up background. --- desktop_version/src/Script.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 98ecd90e..591467f5 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -106,6 +106,15 @@ void scriptclass::run( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, map.warpx=false; map.warpy=false; if(ed.level[curlevel].warpdir==0){ map.background = 1; + //Be careful, we could be in a Lab or Warp Zone room... + if(ed.level[curlevel].tileset==2){ + //Lab + map.background = 2; + dwgfx.rcol = ed.level[curlevel].tilecol; + }else if(ed.level[curlevel].tileset==3){ + //Warp Zone + map.background = 6; + } }else if(ed.level[curlevel].warpdir==1){ map.warpx=true; map.background=3;