diff --git a/code/modules/admin/permissionedit.dm b/code/modules/admin/permissionedit.dm index f020a6e4fb0..e359c60212a 100644 --- a/code/modules/admin/permissionedit.dm +++ b/code/modules/admin/permissionedit.dm @@ -304,6 +304,9 @@ D.deactivate() //after logs so the deadmined admin can see the message. /datum/admins/proc/auto_deadmin() + if (owner.prefs.read_preference(/datum/preference/toggle/bypass_deadmin_in_centcom) && is_centcom_level(owner.mob.z)) + return FALSE + to_chat(owner, span_interface("You are now a normal player."), confidential = TRUE) var/old_owner = owner deactivate() diff --git a/code/modules/client/preferences/admin.dm b/code/modules/client/preferences/admin.dm index 9cc1026d473..5d26cff7c69 100644 --- a/code/modules/client/preferences/admin.dm +++ b/code/modules/client/preferences/admin.dm @@ -39,3 +39,14 @@ return FALSE return is_admin(preferences.parent) + +/datum/preference/toggle/bypass_deadmin_in_centcom + category = PREFERENCE_CATEGORY_GAME_PREFERENCES + savefile_key = "bypass_deadmin_in_centcom" + savefile_identifier = PREFERENCE_PLAYER + +/datum/preference/toggle/bypass_deadmin_in_centcom/is_accessible(datum/preferences/preferences) + if (!..(preferences)) + return FALSE + + return is_admin(preferences.parent) diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/admin.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/admin.tsx index b59aa47fbae..bee21169948 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/admin.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/admin.tsx @@ -1,4 +1,4 @@ -import { FeatureColorInput, Feature, FeatureDropdownInput } from "../base"; +import { CheckboxInput, FeatureColorInput, Feature, FeatureDropdownInput, FeatureToggle } from "../base"; export const asaycolor: Feature = { name: "Admin chat color", @@ -13,3 +13,10 @@ export const brief_outfit: Feature = { description: "The outfit to gain when spawning as the briefing officer.", component: FeatureDropdownInput, }; + +export const bypass_deadmin_in_centcom: FeatureToggle = { + name: "Bypass deadmin options when in CentCom", + category: "ADMIN", + description: "Whether or not to always remain an admin when spawned in CentCom.", + component: CheckboxInput, +};