int area_y = ypos / MINI_TILEY;
int area_sx = SX + xpos;
int area_sy = SY + ypos;
- int i = properties_element - EL_CUSTOM_START;
if (!IS_CUSTOM_ELEMENT(properties_element))
{
return;
}
- ElementContent[0][0][0] = level.custom_element[i].change.successor;
+ ElementContent[0][0][0] = custom_element_change.successor;
DrawElementBorder(area_sx, area_sy, MINI_TILEX, MINI_TILEY);
DrawMiniElement(area_x, area_y, ElementContent[0][0][0]);
{
int i = properties_element - EL_CUSTOM_START;
- level.custom_element[i].change.successor = new_element;
+ custom_element_change.successor = new_element;
+ level.custom_element[i].change = custom_element_change;
}
else if (id == GADGET_ID_RANDOM_BACKGROUND)
random_placement_background_element = new_element;
changing_element[element].base_element = element;
changing_element[element].next_element = change->successor;
- changing_element[i].change_delay = 0;
+ changing_element[element].change_delay = 0;
if (HAS_CHANGE_EVENT(element, CE_DELAY_FIXED))
changing_element[element].change_delay +=
ResetGfxAnimation(x, y);
ResetRandomAnimationValue(x, y);
+#if 1
+ InitField(x, y, FALSE);
+ if (CAN_MOVE(element))
+ InitMovDir(x, y);
+#endif
DrawLevelField(x, y);
if (changing_element[element].post_change_function)
element = Feld[x][y];
graphic = el2img(element);
+#if 0
+ if (element == -1)
+ {
+ printf("::: %d,%d: %d [%d]\n", x, y, element, FrameCounter);
+
+ element = graphic = 0;
+ }
+#endif
+
if (graphic_info[graphic].anim_global_sync)
GfxFrame[x][y] = FrameCounter;
#endif
else if (element == EL_EXPLOSION)
; /* drawing of correct explosion animation is handled separately */
- else if (IS_ANIMATED(graphic))
+ else if (IS_ANIMATED(graphic) && !IS_AUTO_CHANGING(element))
DrawLevelGraphicAnimationIfNeeded(x, y, graphic);
#if 1
- if (IS_AUTO_CHANGING(element))
+ /* this may take place after moving, therefore element may have changed */
+ if (IS_AUTO_CHANGING(Feld[x][y]))
ChangeElement(x, y);
#endif