fixed bug in single button handling causing broken tapes (EM engine)
authorHolger Schemel <info@artsoft.org>
Sat, 23 Sep 2017 20:11:25 +0000 (22:11 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 23 Sep 2017 20:11:25 +0000 (22:11 +0200)
src/events.c
src/game.c
src/game_em/convert.c
src/game_em/export.h

index 80917b0..b450c2b 100644 (file)
@@ -1560,9 +1560,6 @@ void HandleKey(Key key, int key_status)
     static boolean element_dropped[MAX_PLAYERS] = { FALSE,FALSE,FALSE,FALSE };
     int pnr;
 
     static boolean element_dropped[MAX_PLAYERS] = { FALSE,FALSE,FALSE,FALSE };
     int pnr;
 
-    /* initialize unifying snap and drop buttons (EM engine) */
-    game_em.use_single_button = game_em.use_single_button_initial;
-
     for (pnr = 0; pnr < MAX_PLAYERS; pnr++)
     {
       byte key_action = 0;
     for (pnr = 0; pnr < MAX_PLAYERS; pnr++)
     {
       byte key_action = 0;
@@ -1609,9 +1606,6 @@ void HandleKey(Key key, int key_status)
 
       if (tape.single_step && tape.recording && tape.pausing)
       {
 
       if (tape.single_step && tape.recording && tape.pausing)
       {
-       /* do not unify snap and drop buttons in single-step mode (EM engine) */
-       game_em.use_single_button = FALSE;
-
        if (key_status == KEY_PRESSED && key_action & KEY_MOTION)
        {
          TapeTogglePause(TAPE_TOGGLE_AUTOMATIC);
        if (key_status == KEY_PRESSED && key_action & KEY_MOTION)
        {
          TapeTogglePause(TAPE_TOGGLE_AUTOMATIC);
index e87dcd0..8ef02b4 100644 (file)
@@ -2698,7 +2698,7 @@ static void InitGameEngine()
   game.use_block_last_field_bug =
     (game.engine_version < VERSION_IDENT(3,1,1,0));
 
   game.use_block_last_field_bug =
     (game.engine_version < VERSION_IDENT(3,1,1,0));
 
-  game_em.use_single_button = game_em.use_single_button_initial =
+  game_em.use_single_button =
     (game.engine_version > VERSION_IDENT(4,0,0,2));
 
   /* ---------------------------------------------------------------------- */
     (game.engine_version > VERSION_IDENT(4,0,0,2));
 
   /* ---------------------------------------------------------------------- */
index 32c4b60..086bc7a 100644 (file)
@@ -1110,7 +1110,7 @@ void prepare_em_level(void)
   game_em.any_player_moving = FALSE;
   game_em.any_player_snapping = FALSE;
 
   game_em.any_player_moving = FALSE;
   game_em.any_player_snapping = FALSE;
 
-  game_em.use_single_button = game_em.use_single_button_initial = TRUE;
+  game_em.use_single_button = TRUE;
 
   game_em.last_moving_player = 0;      /* default: first player */
 
 
   game_em.last_moving_player = 0;      /* default: first player */
 
index 065d621..365cafe 100644 (file)
@@ -667,7 +667,6 @@ struct GameInfo_EM
   boolean any_player_moving;
   boolean any_player_snapping;
 
   boolean any_player_moving;
   boolean any_player_snapping;
 
-  boolean use_single_button_initial;
   boolean use_single_button;
 
   int last_moving_player;
   boolean use_single_button;
 
   int last_moving_player;