Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Jul 29, 2023
1 parent 8391083 commit 9b5000c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1817,18 +1817,17 @@ not all weapons use normal magazines etc. load_into_chamber() itself is designed
UnregisterSignal(gun_user, list(COMSIG_MOB_MOUSEUP, COMSIG_MOB_MOUSEDOWN, COMSIG_MOB_MOUSEDRAG))

gun_user = to_set
RegisterSignal(gun_user, COMSIG_MOB_MOUSEDOWN, PROC_REF(start_fire))
RegisterSignal(gun_user, COMSIG_MOB_MOUSEDRAG, PROC_REF(change_target))
RegisterSignal(gun_user, COMSIG_MOB_MOUSEUP, PROC_REF(stop_fire))
if(gun_user)
RegisterSignal(gun_user, COMSIG_MOB_MOUSEDOWN, PROC_REF(start_fire))
RegisterSignal(gun_user, COMSIG_MOB_MOUSEDRAG, PROC_REF(change_target))
RegisterSignal(gun_user, COMSIG_MOB_MOUSEUP, PROC_REF(stop_fire))

/obj/item/weapon/gun/hands_swapped(mob/living/carbon/swapper_of_hands)
if(src == swapper_of_hands.get_active_hand())
set_gun_user(swapper_of_hands)
return

if(gun_user)
UnregisterSignal(gun_user, list(COMSIG_MOB_MOUSEUP, COMSIG_MOB_MOUSEDOWN, COMSIG_MOB_MOUSEDRAG))
gun_user = null
set_gun_user(null)

///Update the target if you draged your mouse
/obj/item/weapon/gun/proc/change_target(datum/source, atom/src_object, atom/over_object, turf/src_location, turf/over_location, src_control, over_control, params)
Expand Down

0 comments on commit 9b5000c

Please sign in to comment.