rnd-20030821-2-src
[rocksndiamonds.git] / src / game.c
index 1aef43abbb1143e3ac3952850e5f6aacb438dc3c..1c86acb0cc779f7196f82e660fc7361e9b164a2c 100644 (file)
@@ -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;