Skip to content

Commit

Permalink
Update client click handling for 514 (#13681)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update code/modules/client/client_procs.dm

Co-authored-by: Kyle Spier-Swenson <[email protected]>

---------

Co-authored-by: Kyle Spier-Swenson <[email protected]>
  • Loading branch information
vvvv-vvvv and MrStonedOne authored Aug 4, 2023
1 parent 18ff5b3 commit ca048b1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ca048b1

Please sign in to comment.