From 38212569c2f58866417f26e9c813ed8b23c5b2c4 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 4 Oct 2020 01:52:40 +0200 Subject: [PATCH] added creating engine snapshots when using mouse click events Before, when using mouse click events as CE change events, clicking on a CE with mouse click event did not save a new game engine snapshot, so undo/redo of CE mouse click events did not work. With this change, undo/redo snapshots will also be created when using mouse click events. --- src/game.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/game.c b/src/game.c index 5e4e151f..8b77ddef 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) -- 2.34.1