From 5659525ed2e30c5935ede95ae0445ab4b6ee716e Mon Sep 17 00:00:00 2001 From: obligaron Date: Sat, 19 Mar 2022 09:29:16 +0100 Subject: [PATCH] Simplify RightMouseDown handling --- Source/diablo.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index b65abbba9..050569ff3 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -397,15 +397,16 @@ void RightMouseDown(bool isShiftHeld) SetSpell(); return; } - if ((!sbookflag || !GetRightPanel().Contains(MousePosition)) - && !TryIconCurs() - && (pcursinvitem == -1 || !UseInvItem(MyPlayerId, pcursinvitem))) { - if (pcurs == CURSOR_HAND) { - if (pcursinvitem == -1 || !UseInvItem(MyPlayerId, pcursinvitem)) - CheckPlrSpell(isShiftHeld); - } else if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM) { - NewCursor(CURSOR_HAND); - } + if (sbookflag && GetRightPanel().Contains(MousePosition)) + return; + if (TryIconCurs()) + return; + if (pcursinvitem != -1 && UseInvItem(MyPlayerId, pcursinvitem)) + return; + if (pcurs == CURSOR_HAND) { + CheckPlrSpell(isShiftHeld); + } else if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM) { + NewCursor(CURSOR_HAND); } }