[MIRROR] RangedAttack now takes modifiers. (#3706)

* RangedAttack now takes modifiers. (#57214)

* RangedAttack now takes modifiers.

Co-authored-by: Gurkenglas <gurkenglas@hotmail.de>
This commit is contained in:
SkyratBot
2021-02-28 13:25:00 +01:00
committed by GitHub
parent 81b023df61
commit 7b226dd6e1
7 changed files with 17 additions and 18 deletions

View File

@@ -62,7 +62,7 @@
* * [mob/proc/UnarmedAttack] (atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
* * [atom/proc/attackby] (item,user) - used only when adjacent
* * [obj/item/proc/afterattack] (atom,user,adjacent,params) - used both ranged and adjacent
* * [mob/proc/RangedAttack] (atom,params) - used only ranged, only used for tk and laser eyes but could be changed
* * [mob/proc/RangedAttack] (atom,modifiers) - used only ranged, only used for tk and laser eyes but could be changed
*/
/mob/proc/ClickOn( atom/A, params )
if(world.time <= next_click)
@@ -163,7 +163,7 @@
else
W.afterattack(A,src,0,params)
else
RangedAttack(A,params)
RangedAttack(A,modifiers)
/// Is the atom obscured by a PREVENT_CLICK_UNDER_1 object above it
/atom/proc/IsObscured()
@@ -285,8 +285,8 @@
* for things like ranged glove touches, spitting alien acid/neurotoxin,
* animals lunging, etc.
*/
/mob/proc/RangedAttack(atom/A, params)
if(SEND_SIGNAL(src, COMSIG_MOB_ATTACK_RANGED, A, params) & COMPONENT_CANCEL_ATTACK_CHAIN)
/mob/proc/RangedAttack(atom/A, modifiers)
if(SEND_SIGNAL(src, COMSIG_MOB_ATTACK_RANGED, A, modifiers) & COMPONENT_CANCEL_ATTACK_CHAIN)
return TRUE

View File

@@ -98,13 +98,13 @@
return FALSE
/mob/living/carbon/human/RangedAttack(atom/A, mouseparams)
/mob/living/carbon/human/RangedAttack(atom/A, modifiers)
. = ..()
if(.)
return
if(gloves)
var/obj/item/clothing/gloves/G = gloves
if(istype(G) && G.Touch(A,0,mouseparams)) // for magic gloves
if(istype(G) && G.Touch(A,0,modifiers)) // for magic gloves
return TRUE
if(isturf(A) && get_dist(src,A) <= 1)