X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=016452604f6d734b9e88e55f78561a786fc37f8f;hb=80b3b0a5109b5678a9a921fcd1b4f7046e5e76d0;hp=1aef43abbb1143e3ac3952850e5f6aacb438dc3c;hpb=5d25c2fc3934b3d7e6b02465361569d3a0033bae;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 1aef43ab..01645260 100644 --- a/src/game.c +++ b/src/game.c @@ -3620,7 +3620,8 @@ void StartMoving(int x, int y) if (CAN_FALL(element) && y < lev_fieldy - 1) { - if ((x>0 && IS_PLAYER(x-1, y)) || (x 0 && IS_PLAYER(x - 1, y)) || + (x < lev_fieldx-1 && IS_PLAYER(x + 1, y))) if (JustBeingPushed(x, y)) return; @@ -4021,7 +4022,8 @@ void StartMoving(int x, int y) 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 @@ -5310,13 +5312,14 @@ static void ChangeActiveTrap(int x, int y) static void ChangeElementNowExt(int x, int y, int target_element) { -#if 0 /* !!! let the player exacpe from a suddenly unaccessible element */ - 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; @@ -6341,6 +6344,10 @@ boolean MoveFigureOneStep(struct PlayerInfo *player, if (can_move != MF_MOVING) return can_move; + /* check if DigField() has caused relocation of the player */ + if (player->jx != jx || player->jy != jy) + return MF_NO_ACTION; + StorePlayer[jx][jy] = 0; player->last_jx = jx; player->last_jy = jy;