Skip to content

Commit

Permalink
[MIRROR] Gun safety on deathmatch and bitdomains are off by default (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
Co-authored-by: StealsThePRs <[email protected]>
  • Loading branch information
3 people authored Dec 17, 2024
1 parent e873c2c commit c82ea4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 4 additions & 2 deletions modular_nova/modules/gun_safety/code/safety_component.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c82ea4c

Please sign in to comment.