diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 4a225e1dc36..3bd7d86890b 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -36,6 +36,10 @@ /mob/proc/OnMouseDrag(src_object, over_object, src_location, over_location, src_control, over_control, params) if(istype(loc, /atom)) var/atom/A = loc + if(client && client.buildmode) + build_click(src, client.buildmode, params, A) + return + if(A.RelayMouseDrag(src_object, over_object, src_location, over_location, src_control, over_control, params, src)) return diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 5bb32a0f39a..1725a1b6cb3 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -734,3 +734,20 @@ sleep(1) else stoplag(5) + +/client/MouseDrag(src_object, over_object, src_location, over_location, src_control, over_control, params) + . = ..() + + if(over_object) + var/mob/living/M = mob + if(istype(get_turf(over_object), /atom)) + var/atom/A = get_turf(over_object) + if(src && src.buildmode) + build_click(M, src.buildmode, params, A) + return + + if(istype(M) && !M.incapacitated()) + var/obj/item/gun/gun = mob.get_active_hand() + if(istype(gun) && gun.can_autofire()) + M.set_dir(get_dir(M, over_object)) + gun.Fire(get_turf(over_object), mob, params, (get_dist(over_object, mob) <= 1), FALSE) \ No newline at end of file diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index f0a1fb274f7..5f720b280b5 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -824,14 +824,4 @@ //Autofire /obj/item/gun/proc/can_autofire() - return (can_autofire && world.time >= next_fire_time) - -/client/MouseDrag(src_object, over_object, src_location, over_location, src_control, over_control, params) - . = ..() - if(over_object) - var/mob/living/M = mob - if(istype(M) && !M.incapacitated()) - var/obj/item/gun/gun = mob.get_active_hand() - if(istype(gun) && gun.can_autofire()) - M.set_dir(get_dir(M, over_object)) - gun.Fire(get_turf(over_object), mob, params, (get_dist(over_object, mob) <= 1), FALSE) + return (can_autofire && world.time >= next_fire_time) \ No newline at end of file diff --git a/html/changelogs/Sindorman-build.yml b/html/changelogs/Sindorman-build.yml new file mode 100644 index 00000000000..1d9018a88f3 --- /dev/null +++ b/html/changelogs/Sindorman-build.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: PoZe + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Admin build mode now supports drag-and-build. Where you can hold mouse to continously build."