fixed graphical bug when player enters exit using ultra-fast speed
authorHolger Schemel <holger.schemel@virtion.de>
Thu, 7 Apr 2022 15:31:52 +0000 (17:31 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Thu, 7 Apr 2022 15:31:52 +0000 (17:31 +0200)
This fixes the player graphic getting stuck when entering the exit
under certain circumstances while using ultra-fast player speed.

This bug is described in the following forum topic:

https://www.artsoft.org/forum/viewtopic.php?t=3328

src/game.c

index 726e60ac26faff6f70a5331e8e73f5a092ddf67e..1c33d10b8ef21cceb3570c909ab408321434b2f4 100644 (file)
@@ -13238,9 +13238,6 @@ void ScrollPlayer(struct PlayerInfo *player, int mode)
       }
     }
 
-    player->last_jx = jx;
-    player->last_jy = jy;
-
     if (Tile[jx][jy] == EL_EXIT_OPEN ||
        Tile[jx][jy] == EL_EM_EXIT_OPEN ||
        Tile[jx][jy] == EL_EM_EXIT_OPENING ||
@@ -13258,6 +13255,9 @@ void ScrollPlayer(struct PlayerInfo *player, int mode)
        LevelSolved();
     }
 
+    player->last_jx = jx;
+    player->last_jy = jy;
+
     // this breaks one level: "machine", level 000
     {
       int move_direction = player->MovDir;