From ca048b13919fedf7713090393fe8985d110320ba Mon Sep 17 00:00:00 2001 From: forestbbbbbbb <136390975+forestbbbbbbb@users.noreply.github.com> Date: Fri, 4 Aug 2023 01:06:22 +0000 Subject: [PATCH] Update client click handling for 514 (#13681) * Update client click handling for 514 (#77316) Hey! its 515 time, so i thought we should close up the last compability change from 514 that slipped thru the cracks. under 514 the LEFT/RIGHT/MIDDLE mouse button keys to the mouse param list are set if they are pressed at all, while the `button` param says which mouse button being clicked triggered that action. More mouse code likely needs to be changed to account for this, but this is the most critical path that cared about the distinction between which buttons are being held and which button triggered the current mouse action. Fixes #76836 maybe? * Update code/modules/client/client_procs.dm Co-authored-by: Kyle Spier-Swenson * Update code/modules/client/client_procs.dm Co-authored-by: Kyle Spier-Swenson --------- Co-authored-by: Kyle Spier-Swenson --- code/modules/client/client_procs.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 728f546937088..2991bbd563540 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -419,13 +419,15 @@ return click_intercepted = 0 //Just reset. Let's not keep re-checking forever. var/ab = FALSE - var/list/L = params2list(params) + var/list/modifiers = params2list(params) - var/dragged = L["drag"] - if(dragged && !L[dragged]) + var/button_clicked = LAZYACCESS(modifiers, "button") + + var/dragged = LAZYACCESS(modifiers, "drag") + if(dragged && button_clicked != dragged) return - if(object && object == middragatom && L["left"]) + if(object && object == middragatom && button_clicked == "left") ab = max(0, 5 SECONDS - (world.time - middragtime) * 0.1) var/mcl = CONFIG_GET(number/minute_click_limit)