From 0bcf77b855a16d9457d8597f8512f4ea01a16eef Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 1 Dec 2021 17:52:03 +0100 Subject: [PATCH] [MIRROR] fullauto now checks for incapacitated instead of stat [MDB IGNORE] (#9786) * fullauto now checks for incapacitated instead of stat (#63083) * fullauto now checks for incapacitated instead of stat * Fixes our own fullauto * Tabs indentation moment Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> Co-authored-by: GoldenAlpharex --- code/datums/components/fullauto.dm | 4 ++-- .../code/datums/components/fullauto.dm | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/code/datums/components/fullauto.dm b/code/datums/components/fullauto.dm index 4495a271a3f..6b6aef7a7a1 100644 --- a/code/datums/components/fullauto.dm +++ b/code/datums/components/fullauto.dm @@ -240,7 +240,7 @@ // Gun procs. /obj/item/gun/proc/on_autofire_start(mob/living/shooter) - if(semicd || shooter.stat || !can_trigger_gun(shooter)) + if(semicd || shooter.incapacitated() || !can_trigger_gun(shooter)) return FALSE if(!can_shoot()) shoot_with_empty_chamber(shooter) @@ -260,7 +260,7 @@ /obj/item/gun/proc/do_autofire(datum/source, atom/target, mob/living/shooter, params) SIGNAL_HANDLER - if(semicd || shooter.stat) + if(semicd || shooter.incapacitated()) return NONE if(!can_shoot()) shoot_with_empty_chamber(shooter) diff --git a/modular_skyrat/master_files/code/datums/components/fullauto.dm b/modular_skyrat/master_files/code/datums/components/fullauto.dm index 63240755cef..8617ae64c54 100644 --- a/modular_skyrat/master_files/code/datums/components/fullauto.dm +++ b/modular_skyrat/master_files/code/datums/components/fullauto.dm @@ -249,7 +249,7 @@ // Gun procs. /obj/item/gun/proc/on_autofire_start(mob/living/shooter) - if(!can_shoot(shooter) || !can_trigger_gun(shooter) || semicd) + if(!can_shoot(shooter) || !can_trigger_gun(shooter) || shooter.incapacitated() || semicd) return FALSE var/obj/item/bodypart/other_hand = shooter.has_hand_for_held_index(shooter.get_inactive_hand_index()) if(weapon_weight == WEAPON_HEAVY && (shooter.get_inactive_held_item() || !other_hand)) @@ -264,12 +264,14 @@ return COMPONENT_AUTOFIRE_ONMOUSEDOWN_BYPASS /obj/item/gun/proc/do_autofire(datum/source, atom/target, mob/living/shooter, params) - SIGNAL_HANDLER - if(!can_shoot()) - shoot_with_empty_chamber(shooter) - return FALSE - INVOKE_ASYNC(src, .proc/do_autofire_shot, source, target, shooter, params) - return COMPONENT_AUTOFIRE_SHOT_SUCCESS + SIGNAL_HANDLER + if(shooter.incapacitated()) + return FALSE + if(!can_shoot()) + shoot_with_empty_chamber(shooter) + return FALSE + INVOKE_ASYNC(src, .proc/do_autofire_shot, source, target, shooter, params) + return COMPONENT_AUTOFIRE_SHOT_SUCCESS /obj/item/gun/proc/do_autofire_shot(datum/source, atom/target, mob/living/shooter, params) var/obj/item/gun/akimbo_gun = shooter.get_inactive_held_item()