From c82ea4c5b7c62765a0840e25ca843a31bc958ae2 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Tue, 17 Dec 2024 20:39:50 +0300 Subject: [PATCH] [MIRROR] Gun safety on deathmatch and bitdomains are off by default (#5243) * Gun safety on deathmatch and bitdomains are off by default (#4616) * Update gun.dm * Update gun.dm * Update gun.dm * Alternative * [MIRROR] Gun safety on deathmatch and bitdomains are off by default --------- Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com> Co-authored-by: StealsThePRs --- code/modules/projectiles/gun.dm | 6 ++++-- modular_nova/modules/gun_safety/code/safety_component.dm | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 10b4fd4a2b6..4c751f5a899 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -77,8 +77,10 @@ pin = new pin(src) add_seclight_point() - give_gun_safeties() // NOVA EDIT ADDITION - GUN SAFETIES - give_manufacturer_examine() // NOVA EDIT ADDITON - MANUFACTURER EXAMINE + // NOVA EDIT ADDITION BEGIN - GUN SAFETIES AND MANUFACTURER EXAMINE + give_gun_safeties() + give_manufacturer_examine() + // NOVA EDIT ADDITION END add_bayonet_point() /obj/item/gun/Destroy() diff --git a/modular_nova/modules/gun_safety/code/safety_component.dm b/modular_nova/modules/gun_safety/code/safety_component.dm index a3e904021ed..7917c4adffa 100644 --- a/modular_nova/modules/gun_safety/code/safety_component.dm +++ b/modular_nova/modules/gun_safety/code/safety_component.dm @@ -5,18 +5,20 @@ /// Holder for the toggle safety action var/datum/action/item_action/gun_safety_toggle/toggle_safety_action -/datum/component/gun_safety/Initialize(safety_currently_on = TRUE) +/datum/component/gun_safety/Initialize() . = ..() // Obviously gun safety should only apply to guns if(!isgun(parent)) return COMPONENT_INCOMPATIBLE - src.safety_currently_on = safety_currently_on var/obj/item/item_parent = parent toggle_safety_action = item_parent.add_item_action(/datum/action/item_action/gun_safety_toggle) + if(is_reserved_level(item_parent.z) && !istype(get_area(item_parent.loc), /area/shuttle)) + src.safety_currently_on = FALSE + update_action_button_state() /datum/component/gun_safety/Destroy()