rnd-20031103-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 2 Nov 2003 23:23:47 +0000 (00:23 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:44:23 +0000 (10:44 +0200)
src/conftime.h
src/game.c

index ebc817944592b02a44f25c55aa6b55f17a34a95e..79313b9409f650d8f07b4a887fabf0864ed86baf 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-11-02 13:42]"
+#define COMPILE_DATE_STRING "[2003-11-02 22:04]"
index a46368e1a87874e31529b510d780db0d2b0848a9..3bb6aa59dde50c6492f5a797839b4fbdbc97267e 100644 (file)
@@ -98,6 +98,8 @@
                                 RND(element_info[e].push_delay_random))
 #define GET_NEW_MOVE_DELAY(e)  (   (element_info[e].move_delay_fixed) + \
                                 RND(element_info[e].move_delay_random))
+#define GET_MAX_MOVE_DELAY(e)  (   (element_info[e].move_delay_fixed) + \
+                                   (element_info[e].move_delay_random))
 
 #define ELEMENT_CAN_ENTER_FIELD_GENERIC(e, x, y, condition)            \
                (IN_LEV_FIELD(x, y) && (IS_FREE(x, y) ||                \
@@ -7894,6 +7896,21 @@ int DigField(struct PlayerInfo *player,
            !(element == EL_SPRING && use_spring_bug))
          return MF_NO_ACTION;
 
+#if 1
+       if (CAN_MOVE(element) && GET_MAX_MOVE_DELAY(element) == 0 &&
+           ((move_direction & MV_VERTICAL &&
+             ((element_info[element].move_pattern & MV_LEFT &&
+               IN_LEV_FIELD(x - 1, y) && IS_FREE(x - 1, y)) ||
+              (element_info[element].move_pattern & MV_RIGHT &&
+               IN_LEV_FIELD(x + 1, y) && IS_FREE(x + 1, y)))) ||
+            (move_direction & MV_HORIZONTAL &&
+             ((element_info[element].move_pattern & MV_UP &&
+               IN_LEV_FIELD(x, y - 1) && IS_FREE(x, y - 1)) ||
+              (element_info[element].move_pattern & MV_DOWN &&
+               IN_LEV_FIELD(x, y + 1) && IS_FREE(x, y + 1))))))
+         return MF_NO_ACTION;
+#endif
+
 #if 1
        /* do not push elements already moving away faster than player */
        if (CAN_MOVE(element) && MovDir[x][y] == move_direction &&