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

Disable suicide config #76

Merged
merged 2 commits into from
Sep 23, 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
5 changes: 5 additions & 0 deletions code/modules/client/verbs/suicide.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@

/// Checks if we are in a valid state to suicide (not already suiciding, capable of actually killing ourselves, area checks, etc.) Returns TRUE if we can suicide, FALSE if we can not.
/mob/living/proc/can_suicide()
// DOPPLER EDIT ADDITION
if(CONFIG_GET(flag/disable_suicide))
to_chat(src, span_warning("Suicide is disabled on this server."))
return FALSE
// DOPPLER EDIT END
if(HAS_TRAIT_FROM_ONLY(src, TRAIT_SUICIDED, REF(src)))
to_chat(src, span_warning("You are already commiting suicide!"))
return FALSE
Expand Down
2 changes: 2 additions & 0 deletions config/doppler/config_doppler.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ COMBAT_INDICATOR
## How long until someone can be put in cryo if they are SSD, default is 9000 (15 minutes)
CRYO_MIN_SSD_TIME 9000

## If uncommented, suicide will be disabled.
DISABLE_SUICIDE
2 changes: 2 additions & 0 deletions modular_doppler/disable_suicide/config_entries.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Disables the ability to commit suicide
/datum/config_entry/flag/disable_suicide
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6525,6 +6525,7 @@
#include "modular_doppler\deforest_medical_items\code\chemicals\twitch.dm"
#include "modular_doppler\deforest_medical_items\code\medstation_designs\blood.dm"
#include "modular_doppler\deforest_medical_items\code\medstation_designs\medical.dm"
#include "modular_doppler\disable_suicide\config_entries.dm"
#include "modular_doppler\emotes\code\emotes.dm"
#include "modular_doppler\emotes\code\hologram.dm"
#include "modular_doppler\emotes\code\added_emotes\animal_sounds.dm"
Expand Down
Loading