X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=b39383fdd3cbcb0d789e1f97ca213454de3db429;hb=020b38ef4e6b4adcb7c0755366e3ba5adf1180dc;hp=5e4e151fe3134c7548cce810dff6eb1f72fe7648;hpb=b0a2ac4eef8d8155fb616b31899f04030746f94e;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 5e4e151f..b39383fd 100644 --- a/src/game.c +++ b/src/game.c @@ -11200,6 +11200,15 @@ static void CheckSaveEngineSnapshot(struct PlayerInfo *player) if (!player->is_dropping) player->was_dropping = FALSE; } + + static struct MouseActionInfo mouse_action_last = { 0 }; + struct MouseActionInfo mouse_action = player->effective_mouse_action; + boolean new_released = (!mouse_action.button && mouse_action_last.button); + + if (new_released) + CheckSaveEngineSnapshotToList(); + + mouse_action_last = mouse_action; } static void CheckSingleStepMode(struct PlayerInfo *player) @@ -13988,6 +13997,10 @@ static int DigField(struct PlayerInfo *player, CheckTriggeredElementChangeByPlayer(x, y, element, CE_PLAYER_DIGS_X, player->index_bit, dig_side); + // if digging triggered player relocation, finish digging tile + if (mode == DF_DIG && (player->jx != jx || player->jy != jy)) + setFieldForSnapping(x, y, element, move_direction); + if (mode == DF_SNAP) { if (level.block_snap_field) @@ -14109,9 +14122,15 @@ static int DigField(struct PlayerInfo *player, PlayLevelSoundElementAction(x, y, element, ACTION_COLLECTING); if (is_player) + { CheckTriggeredElementChangeByPlayer(x, y, element, CE_PLAYER_COLLECTS_X, player->index_bit, dig_side); + // if collecting triggered player relocation, finish collecting tile + if (mode == DF_DIG && (player->jx != jx || player->jy != jy)) + setFieldForSnapping(x, y, element, move_direction); + } + if (mode == DF_SNAP) { if (level.block_snap_field) @@ -15233,6 +15252,9 @@ void RequestRestartGame(char *message) } else { + // needed in case of envelope request to close game panel + CloseDoor(DOOR_CLOSE_1); + SetGameStatus(GAME_MODE_MAIN); DrawMainMenu();