rnd-20030821-2-src
[rocksndiamonds.git] / src / game.c
index 5956c7d899ca466076188317e162b2fbad6382b1..1c86acb0cc779f7196f82e660fc7361e9b164a2c 100644 (file)
@@ -1237,7 +1237,7 @@ void InitGame()
       if (CAN_CHANGE(element))
       {
        content = element_info[element].change.target_element;
-       is_player = (ELEM_IS_PLAYER(content) || content == EL_SP_MURPHY);
+       is_player = ELEM_IS_PLAYER(content);
 
        if (is_player && (found_rating < 3 || element < found_element))
        {
@@ -1252,7 +1252,7 @@ void InitGame()
       for(yy=0; yy < 3; yy++) for(xx=0; xx < 3; xx++)
       {
        content = element_info[element].content[xx][yy];
-       is_player = (ELEM_IS_PLAYER(content) || content == EL_SP_MURPHY);
+       is_player = ELEM_IS_PLAYER(content);
 
        if (is_player && (found_rating < 2 || element < found_element))
        {
@@ -1267,7 +1267,7 @@ void InitGame()
          continue;
 
        content = element_info[element].change.content[xx][yy];
-       is_player = (ELEM_IS_PLAYER(content) || content == EL_SP_MURPHY);
+       is_player = ELEM_IS_PLAYER(content);
 
        if (is_player && (found_rating < 1 || element < found_element))
        {
@@ -5310,7 +5310,8 @@ static void ChangeActiveTrap(int x, int y)
 
 static void ChangeElementNowExt(int x, int y, int target_element)
 {
-#if 0  /* !!! let the player exacpe from a suddenly unaccessible element */
+#if 1
+  /* check if the new element is unaccessible for the player */
   if (IS_PLAYER(x, y) && !IS_ACCESSIBLE(target_element))
   {
     Bang(x, y);
@@ -6341,6 +6342,10 @@ boolean MoveFigureOneStep(struct PlayerInfo *player,
   if (can_move != MF_MOVING)
     return can_move;
 
+  /* check if DigField() has caused relocation of the player */
+  if (player->jx != jx || player->jy != jy)
+    return MF_NO_ACTION;
+
   StorePlayer[jx][jy] = 0;
   player->last_jx = jx;
   player->last_jy = jy;
@@ -6586,6 +6591,7 @@ void ScrollFigure(struct PlayerInfo *player, int mode)
     if (Feld[jx][jy] == EL_EXIT_OPEN ||
        Feld[jx][jy] == EL_SP_EXIT_OPEN)
     {
+      DrawPlayer(player);      /* needed here only to cleanup last field */
       RemoveHero(player);
 
       if (local_player->friends_still_needed == 0 ||