Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Gun safety on deathmatch and bitdomains are off by default #5243

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading