if (CAN_FALL(element) && y < lev_fieldy - 1)
{
- if ((x>0 && IS_PLAYER(x-1, y)) || (x<lev_fieldx-1 && IS_PLAYER(x+1, y)))
+ if ((x > 0 && IS_PLAYER(x - 1, y)) ||
+ (x < lev_fieldx-1 && IS_PLAYER(x + 1, y)))
if (JustBeingPushed(x, y))
return;
Moving2Blocked(x, y, &newx, &newy); /* get next screen position */
- if (DONT_COLLIDE_WITH(element) && IS_PLAYER(newx, newy) &&
+ if (DONT_COLLIDE_WITH(element) &&
+ IN_LEV_FIELD(newx, newy) && IS_PLAYER(newx, newy) &&
!PLAYER_PROTECTED(newx, newy))
{
#if 1
static void ChangeElementNowExt(int x, int y, int target_element)
{
-#if 1
- /* check if the new element is unaccessible for the player */
- if (IS_PLAYER(x, y) && !IS_ACCESSIBLE(target_element))
+ /* check if element under player changes from accessible to unaccessible
+ (needed for special case of dropping element which then changes) */
+ if (IS_PLAYER(x, y) &&
+ IS_ACCESSIBLE(Feld[x][y]) && !IS_ACCESSIBLE(target_element))
{
Bang(x, y);
return;
}
-#endif
RemoveField(x, y);
Feld[x][y] = target_element;