Skip to content

Commit

Permalink
Merge pull request #76 from honkpocket/disable-suicide
Browse files Browse the repository at this point in the history
Disable suicide config
  • Loading branch information
Nerev4r authored Sep 23, 2024
2 parents 1cc0254 + b178113 commit 87dad10
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
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

0 comments on commit 87dad10

Please sign in to comment.