From b3be4ab65e15fe19322cc7878e990ffecf81b1f6 Mon Sep 17 00:00:00 2001 From: obligaron Date: Fri, 21 Oct 2022 21:02:59 +0200 Subject: [PATCH] TimeoutCursor: Only restore previous cursor when cursor is not already changed --- Source/diablo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 7e03516b1..3a6f12e20 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1325,7 +1325,11 @@ void TimeoutCursor(bool bTimeout) } scrollrt_draw_game_screen(); } else if (sgnTimeoutCurs != CURSOR_NONE) { - NewCursor(sgnTimeoutCurs); + // Timeout is gone, we should restore the previous cursor. + // But the timeout cursor could already be changed by the now processed messages (for example item cursor from CMD_GETITEM). + // Changing the item cursor back to the previous (hand) cursor could result in deleted items, cause this resets Player.HoldItem (see NewCursor). + if (pcurs == CURSOR_HOURGLASS) + NewCursor(sgnTimeoutCurs); sgnTimeoutCurs = CURSOR_NONE; InfoString = {}; force_redraw = 255;