fixed bug causing BD engine hanging in wrap-around scrolling edge case
authorHolger Schemel <holger.schemel@virtion.de>
Mon, 1 Jul 2024 08:17:37 +0000 (10:17 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Mon, 1 Jul 2024 08:17:53 +0000 (10:17 +0200)
src/game_bd/bd_graphics.c

index c509ec57ecd716f54e7739315209ebf614fa203b..793987e285c985a8840d2f0e73d558803e61b363 100644 (file)
@@ -334,6 +334,11 @@ boolean gd_scroll(GdGame *game, boolean exact_scroll, boolean immediate)
     scroll_speed_last = -1;
 
   // check if active player is visible at the moment.
+  // but only if scrolling happened at all!
+  if (!changed)
+    return FALSE;
+
+  // check if active player is outside drawing area. if yes, we should wait for scrolling.
   return player_out_of_window(game, player_x, player_y);
 }