Build mode drag-and-build functionality (#8936)

This commit is contained in:
Mykhailo Bykhovtsev
2020-05-26 15:31:59 +02:00
committed by GitHub
parent dfe07d929c
commit bd7f500803
4 changed files with 63 additions and 11 deletions
+1 -11
View File
@@ -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)