X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgame.c;h=74c934d291b4284f04e963b5b53d3f911edb69a8;hb=a7714efc55468a9c97e9d36116ec16e5b8875422;hp=1aef43abbb1143e3ac3952850e5f6aacb438dc3c;hpb=5d25c2fc3934b3d7e6b02465361569d3a0033bae;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 1aef43ab..74c934d2 100644 --- a/src/game.c +++ b/src/game.c @@ -5310,13 +5310,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 +6342,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;