+ /* prevent scrolling (for screen correcting) if no player is moving */
+ if (!game_em.any_player_moving)
+ {
+ screen_x = screen_x_old;
+ screen_y = screen_y_old;
+ }
+ else
+ {
+ /* prevent scrolling against the players move direction */
+ int player_nr = (game.centered_player_nr == -1 ?
+ max_center_distance_player_nr : game.centered_player_nr);
+ int player_move_dir = game_em.last_player_direction[player_nr];
+ int dx = SIGN(screen_x - screen_x_old);
+ int dy = SIGN(screen_y - screen_y_old);
+
+ if ((dx < 0 && player_move_dir != MV_LEFT) ||
+ (dx > 0 && player_move_dir != MV_RIGHT))
+ screen_x = screen_x_old;
+
+ if ((dy < 0 && player_move_dir != MV_UP) ||
+ (dy > 0 && player_move_dir != MV_DOWN))
+ screen_y = screen_y_old;
+ }