added description for BD style explosion
[rocksndiamonds.git] / src / game_bd / bd_caveengine.c
index 61f71d37dd28dd32ca84a34518b3efd96b662ca2..03722b801ca1e62f9943f583685a8ea07d2745ea 100644 (file)
@@ -983,17 +983,18 @@ static GdElement player_get_element(GdCave* cave, const GdElement object, int x,
   process a crazy dream-style teleporter.
   called from gd_cave_iterate, for a player or a player_bomb.
   player is standing at px, py, and trying to move in the direction player_move,
-  where there is a teleporter.
-  we check the whole cave, from px+1,py, till we get back to px,py (by wrapping
+  where there is a teleporter at (tx_start, ty_start). we check the whole cave,
+  from (tx_start + 1, ty_start), till we get back to (tx_start, ty_start) (by wrapping
   around). the first teleporter we find, and which is suitable, will be the destination.
   return TRUE if teleporter worked, FALSE if cound not find any suitable teleporter.
- */
+*/
 static boolean do_teleporter(GdCave *cave, int px, int py, GdDirection player_move)
 {
-  int tx, ty;
-
-  tx = px;
-  ty = py;
+  // start at teleporter position (not at player position!)
+  int tx_start = px + gd_dx[player_move];
+  int ty_start = py + gd_dy[player_move];
+  int tx = tx_start;
+  int ty = ty_start;
 
   do
   {
@@ -1025,7 +1026,7 @@ static boolean do_teleporter(GdCave *cave, int px, int py, GdDirection player_mo
     }
   }
   // loop until we get back to original coordinates
-  while (tx != px || ty != py);
+  while (tx != tx_start || ty != ty_start);
 
   // return false as we did not find any usable teleporter
   return FALSE;
@@ -3040,6 +3041,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire,
              }
            }
            else
+           {
              // or space over the slime? elements may pass from bottom to up then.
              if (is_space_dir(cave, x, y, oppos))
              {
@@ -3063,6 +3065,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire,
                  play_sound_of_element(cave, O_SLIME, x, y);
                }
              }
+           }
          }
          break;
 
@@ -3470,7 +3473,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire,
   // PLAYER
 
   // check if player is alive.
-  if ((cave->player_state == GD_PL_LIVING && cave->player_seen_ago > 15) || cave->kill_player)
+  if ((cave->player_state == GD_PL_LIVING && cave->player_seen_ago > 1) || cave->kill_player)
     cave->player_state = GD_PL_DIED;
 
   // check if any voodoo exploded, and kill players the next scan if that happended.