if (cave->magic_wall_state == GD_MW_DORMANT)
cave->magic_wall_state = GD_MW_ACTIVE;
- if (cave->magic_wall_state == GD_MW_ACTIVE &&
- is_like_space(cave, x, y, twice[fall_dir]))
+ if (cave->magic_wall_state == GD_MW_ACTIVE)
{
- // if magic wall active and place underneath, it turns element
- // into anything the effect says to do.
- store_dir(cave, x, y, twice[fall_dir], magic);
+ if (is_like_space(cave, x, y, twice[fall_dir]))
+ {
+ // if magic wall active and place underneath, it turns element
+ // into anything the effect says to do.
+ store_dir(cave, x, y, twice[fall_dir], magic);
+ }
+ else
+ {
+ // store from/to directions in special buffers for smooth movement animations
+ store_dir_buffer(cave, x, y, fall_dir);
+ }
}
// active or non-active or anything, element falling in will always disappear
tile_from = game->element_buffer[new_y][new_x];
draw_from = game->drawing_buffer[new_y][new_x];
- if (is_double_movement)
+ if (is_double_movement || tile_from == O_MAGIC_WALL)
{
- // for magic wall or slime, use source tile instead of target tile
+ // for magic wall or slime, use source tile instead of (changed) target tile
+ // also required for element falling into magic wall with no space below it
tile_from = tile_last;
draw_from = draw_last;
}