-#define COMPILE_DATE_STRING "[2004-04-11 03:36]"
+#define COMPILE_DATE_STRING "[2004-04-12 20:40]"
{ CE_HIT_BY_SOMETHING, "hit by something" },
#else
{ CE_HITTING_SOMETHING, "collision" },
+#endif
+#if 1
+ { CE_BLOCKED, "blocked" },
#endif
{ CE_IMPACT, "impact (on something)" },
{ CE_SMASHED, "smashed (from above)" },
HAS_CHANGE_EVENT(element, CE_SWITCHED) ? CE_SWITCHED :
HAS_CHANGE_EVENT(element, CE_HITTING_SOMETHING) ? CE_HITTING_SOMETHING :
HAS_CHANGE_EVENT(element, CE_HIT_BY_SOMETHING) ? CE_HIT_BY_SOMETHING :
+ HAS_CHANGE_EVENT(element, CE_BLOCKED) ? CE_BLOCKED :
HAS_CHANGE_EVENT(element, CE_IMPACT) ? CE_IMPACT :
HAS_CHANGE_EVENT(element, CE_SMASHED) ? CE_SMASHED :
custom_element_change.direct_action);
custom_element_change_events[CE_SWITCHED] = FALSE;
custom_element_change_events[CE_HITTING_SOMETHING] = FALSE;
custom_element_change_events[CE_HIT_BY_SOMETHING] = FALSE;
+ custom_element_change_events[CE_BLOCKED] = FALSE;
custom_element_change_events[CE_IMPACT] = FALSE;
custom_element_change_events[CE_SMASHED] = FALSE;
custom_element_change_events[custom_element_change.direct_action] =
WasJustFalling[x][y] = 0;
#endif
+ CheckCollision[x][y] = 0;
+
Impact(x, y);
}
else if (IS_FREE(x, y + 1) && element == EL_SPRING && level.use_spring_bug)
}
/* not "else if" because of elements that can fall and move (EL_SPRING) */
+#if 0
+ if (CAN_MOVE(element) && !started_moving && MovDir[x][y] != MV_NO_MOVING)
+#else
if (CAN_MOVE(element) && !started_moving)
+#endif
{
int move_pattern = element_info[element].move_pattern;
int newx, newy;
+#if DEBUG
+ if (MovDir[x][y] == MV_NO_MOVING)
+ {
+ printf("StartMoving(): %d,%d: element %d ['%s'] not moving\n",
+ x, y, element, element_info[element].token_name);
+ printf("StartMoving(): This should never happen!\n");
+ }
+#endif
+
Moving2Blocked(x, y, &newx, &newy);
#if 1
WasJustMoving[x][y] = 0;
#endif
+ CheckCollision[x][y] = 0;
+
TestIfElementHitsCustomElement(x, y, MovDir[x][y]);
#if 0
TurnRound(x, y);
+ if (move_pattern & MV_ANY_DIRECTION &&
+ move_pattern == MovDir[x][y])
+ {
+ int blocking_element =
+ (IN_LEV_FIELD(newx, newy) ? Feld[newx][newy] : BorderElement);
+
+#if 0
+ printf("::: '%s' is blocked by '%s'! [%d,%d -> %d,%d]\n",
+ element_info[element].token_name,
+ element_info[blocking_element].token_name,
+ x, y, newx, newy);
+#endif
+
+ CheckElementChangeBySide(x, y, element, blocking_element, CE_BLOCKED,
+ MovDir[x][y]);
+
+ element = Feld[x][y]; /* element might have changed */
+ }
+
#if 1
if (GFX_ELEMENT(element) != EL_SAND) /* !!! FIX THIS (crumble) !!! */
DrawLevelElementAnimation(x, y, element);
/* prevent elements on conveyor belt from moving on in last direction */
if (pushed_by_conveyor && CAN_FALL(element) &&
direction & MV_HORIZONTAL)
- MovDir[newx][newy] = 0;
+ {
+ if (CAN_MOVE(element))
+ InitMovDir(newx, newy);
+ else
+ MovDir[newx][newy] = 0;
+ }
#endif
if (!pushed_by_player)
#define CE_HIT_BY_SOMETHING 27
#define CE_OTHER_IS_HITTING 28
#define CE_OTHER_GETS_HIT 29
+#define CE_BLOCKED 30
-#define NUM_CHANGE_EVENTS 30
+#define NUM_CHANGE_EVENTS 31
#define CE_BITMASK_DEFAULT 0
if (redraw_mask & REDRAW_TILES)
{
for (x = 0; x < SCR_FIELDX; x++)
- for (y =0 ; y < SCR_FIELDY; y++)
+ for (y = 0 ; y < SCR_FIELDY; y++)
if (redraw[redraw_x1 + x][redraw_y1 + y])
BlitBitmap(buffer, window,
- FX + x * TILEX, FX + y * TILEY, TILEX, TILEY,
+ FX + x * TILEX, FY + y * TILEY, TILEX, TILEY,
SX + x * TILEX, SY + y * TILEY);
}