element_info[element].use_gfx_element = FALSE;
element_info[element].gfx_element = EL_EMPTY_SPACE;
+
+ element_info[element].modified_settings = FALSE;
}
if (IS_CUSTOM_ELEMENT(element) ||
/* now set default properties */
SET_PROPERTY(element, EP_CAN_MOVE_INTO_ACID, TRUE);
-
- element_info[element].modified_settings = FALSE;
}
if (IS_GROUP_ELEMENT(element) ||
}
/* initialize "can_explode" field for old levels which did not store this */
- if (level->game_version <= VERSION_IDENT(3,1,0,2))
+ if (level->game_version <= VERSION_IDENT(3,1,0,0))
{
for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
{
{
#if 1
/* use random direction as default start direction */
- if (game.engine_version >= VERSION_IDENT(3,1,0,2))
+ if (game.engine_version >= VERSION_IDENT(3,1,0,0))
MovDir[x][y] = 1 << RND(4);
#endif
TestIfPlayerTouchesCustomElement(jx, jy);
#endif
-#if 1
+#if 0
+ printf("::: %d,%d: %d\n", jx, jy-1, Changed[jx][jy-1]);
+#endif
+
+#if 0
+#if 0
+ /* needed to allow change of walkable custom element by entering player */
+ if (!(Changed[jx][jy] & CH_EVENT_BIT(CE_ENTERED_BY_PLAYER)))
+ Changed[jx][jy] = 0; /* allow another change (but prevent loop) */
+#else
/* needed to allow change of walkable custom element by entering player */
Changed[jx][jy] = 0; /* allow another change */
#endif
+#endif
#if 0
printf("::: player entering %d, %d from %s ...\n", jx, jy,
#if 1
if (game.engine_version >= VERSION_IDENT(3,1,0,0) &&
- CheckCollision[x][y] && IN_LEV_FIELD_AND_NOT_FREE(newx, newy))
+ CheckCollision[x][y] && !IN_LEV_FIELD_AND_IS_FREE(newx, newy))
#else
if (game.engine_version >= VERSION_IDENT(3,1,0,0) &&
WasJustMoving[x][y] && IN_LEV_FIELD(newx, newy) &&
DrawLevelFieldCrumbledSandNeighbours(x, y);
}
+#if 0
Changed[x][y] |= ChangeEvent[x][y]; /* ignore same changes in this frame */
+#endif
#if 0
TestIfBadThingTouchesHero(x, y);
TestIfElementTouchesCustomElement(x, y);
#endif
+ /* "Changed[][]" not set yet to allow "entered by player" change one time */
if (ELEM_IS_PLAYER(target_element))
RelocatePlayer(x, y, target_element);
+#if 1
+ Changed[x][y] |= ChangeEvent[x][y]; /* ignore same changes in this frame */
+#endif
+
#if 1
TestIfBadThingTouchesHero(x, y);
TestIfPlayerTouchesCustomElement(x, y);
continue;
}
+#if 0
+ if (Changed[ex][ey]) /* do not change already changed elements */
+ {
+ can_replace[xx][yy] = FALSE;
+ complete_replace = FALSE;
+
+ continue;
+ }
+#endif
+
e = Feld[ex][ey];
if (IS_MOVING(ex, ey) || IS_BLOCKED(ex, ey))
TestIfPlayerTouchesCustomElement(jx, jy);
#if 1
#if 1
- /* needed because pushed element has not yet reached its destination */
+ /* needed because pushed element has not yet reached its destination,
+ so it would trigger a change event at its previous field location */
if (!player->is_pushing)
#endif
TestIfElementTouchesCustomElement(jx, jy); /* for empty space */
nexty = dropy + GET_DY_FROM_DIR(move_direction);
#if 1
- Changed[dropx][dropy] = 0; /* allow another change */
- CheckCollision[dropx][dropy] = 2;
+ Changed[dropx][dropy] = 0; /* allow another change */
+ CheckCollision[dropx][dropy] = 2;
#else
- if (IN_LEV_FIELD(nextx, nexty) && IS_FREE(nextx, nexty))
+ if (IN_LEV_FIELD_AND_IS_FREE(nextx, nexty))
{
#if 0
WasJustMoving[dropx][dropy] = 3;
#endif
#endif
}
-#if 1
+#if 0
+ /* !!! commented out from 3.1.0-4 to 3.1.0-5 !!! */
else
{
Changed[dropx][dropy] = 0; /* allow another change */