From: Holger Schemel Date: Mon, 21 Jan 2019 20:38:18 +0000 (+0100) Subject: fixed bug with incorrectly initializing snapping in single-step mode X-Git-Tag: 4.1.2.0~47 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=899e06c2695b543b93364993f12b46caa33e6cd7 fixed bug with incorrectly initializing snapping in single-step mode When in single-step mode, snapping a tile (by using either TAS snap keys or by using snap+direction keys) is followed by immediately returning to pause mode. While this is fine, it was also followed by initializing snapping (just as if the keys for snapping have been released, which is usually indeed the case when in single-step mode, but may be followed by pressing keys for snapping again, so the game engine gets pressed snap keys in two subsequent frames without any frame with "no snapping" action in between). When replaying a tape with such snap actions (as recorded while playing), there is only one single snap action (lasting two frames) when replaying, while there were two snap actions (both lasting one frame) when recording, which may result in different behaviour when replaying a recorded game. (This can easily be tested by snapping several falling gems while in single-step mode.) This bug was fixed by removing the incorrect initialization of snapping when returning to pause mode in single-step mode. --- diff --git a/src/game.c b/src/game.c index 52ea4329..20157c6d 100644 --- a/src/game.c +++ b/src/game.c @@ -11058,10 +11058,7 @@ static void CheckSingleStepMode(struct PlayerInfo *player) if (!player->is_moving && !player->is_pushing && !player->is_dropping_pressed) - { TapeTogglePause(TAPE_TOGGLE_AUTOMATIC); - SnapField(player, 0, 0); // stop snapping - } } CheckSaveEngineSnapshot(player);