Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves click_adjacent logic to MouseDown #6582

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
~ BMC777
*/

/client/Click(atom/A, location, control, params)
/client/Click(atom/A, location, control, params, mouse_down=FALSE)
to_world("Mouse Down: [mouse_down] Ignore Next Click: [ignore_next_click]")
Git-Nivrak marked this conversation as resolved.
Show resolved Hide resolved
if (control && !ignore_next_click) // No .click macros allowed, and only one click per mousedown.
ignore_next_click = TRUE
return usr.do_click(A, location, params)
return usr.do_click(A, location, params, mouse_down)

/mob/proc/do_click(atom/A, location, params)
/mob/proc/do_click(atom/A, location, params, mouse_down)
// We'll be sending a lot of signals and things later on, this will save time.
if(!client)
return
Expand Down Expand Up @@ -130,9 +131,10 @@
return

next_move = world.time
// If standing next to the atom clicked.
// Ontop or right next to us
if(A.Adjacent(src))
click_adjacent(A, W, mods)
if(mouse_down)
click_adjacent(A, W, mods)
return

// If not standing next to the atom clicked.
Expand Down
3 changes: 3 additions & 0 deletions code/_onclick/click_hold.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@

Click(A, T, skin_ctl, params)

if(A.Adjacent(mob))
Click(A, T, skin_ctl, params, TRUE)

/client/MouseUp(atom/A, turf/T, skin_ctl, params)
if(!A)
return
Expand Down
Loading