From b885622729a2994e02168c2006f68070afc478dd Mon Sep 17 00:00:00 2001 From: Casey Date: Wed, 22 Dec 2021 08:57:13 -0500 Subject: [PATCH 1/2] Merge pull request #12026 from VOREStation/upstream-merge-8361 [MIRROR] Adds checking on target to mob shoot_target proc. --- code/modules/mob/living/simple_mob/combat.dm | 4 ++++ .../mob/living/simple_mob/subtypes/humanoid/mercs/mercs.dm | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/code/modules/mob/living/simple_mob/combat.dm b/code/modules/mob/living/simple_mob/combat.dm index b38317b964..3ff7eb5b2d 100644 --- a/code/modules/mob/living/simple_mob/combat.dm +++ b/code/modules/mob/living/simple_mob/combat.dm @@ -86,6 +86,10 @@ //The actual top-level ranged attack proc /mob/living/simple_mob/proc/shoot_target(atom/A) set waitfor = FALSE + + if(!istype(A) || QDELETED(A)) + return + setClickCooldown(get_attack_speed()) face_atom(A) diff --git a/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs.dm b/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs.dm index cf6b2649a8..45c88cbfec 100644 --- a/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs.dm +++ b/code/modules/mob/living/simple_mob/subtypes/humanoid/mercs/mercs.dm @@ -304,6 +304,10 @@ /mob/living/simple_mob/humanoid/merc/ranged/sniper/shoot_target(atom/A) set waitfor = FALSE + + if(!istype(A) || QDELETED(A)) + return + setClickCooldown(get_attack_speed()) face_atom(A)