fixed wrap-around with entering EM style door (gate) for EM engine
[rocksndiamonds.git] / src / game_em / logic.c
index 4b489d8a507dee65da5f9b7c35f79bb48ec62cc2..a56547b14a462365e830a8cdfbdb59ac0adead0b 100644 (file)
@@ -58,18 +58,6 @@ static const byte is_blank_or_acid[GAME_TILE_MAX] =
   [Xacid_8]            = 1
 };
 
-static const byte is_fake_acid[GAME_TILE_MAX] =
-{
-  [Xfake_acid_1]       = 1,
-  [Xfake_acid_2]       = 1,
-  [Xfake_acid_3]       = 1,
-  [Xfake_acid_4]       = 1,
-  [Xfake_acid_5]       = 1,
-  [Xfake_acid_6]       = 1,
-  [Xfake_acid_7]       = 1,
-  [Xfake_acid_8]       = 1
-};
-
 static const byte is_player[GAME_TILE_MAX] =
 {
   [Zplayer]            = 1,
@@ -7707,10 +7695,12 @@ void logic_move(void)
     if (ply[i].x < lev.left ||
        ply[i].x > lev.right - 1)
     {
-      ply[i].x = (ply[i].x < lev.left ? lev.right - 1 : lev.left);
+      int direction = (ply[i].x < lev.left ? -1 : 1);
+
+      ply[i].x += -direction * lev.width;
 
       if (!lev.infinite_true)
-       ply[i].y += (ply[i].x == lev.left ? 1 : -1);
+       ply[i].y += direction;
 
       game.centered_player_nr_next = i;
       game.set_centered_player = TRUE;