Configuration datum refactor
This commit is contained in:
committed by
CitadelStationBot
parent
d25894447e
commit
e5ef3d2405
@@ -1,15 +1,16 @@
|
||||
/client/proc/panicbunker()
|
||||
set category = "Server"
|
||||
set name = "Toggle Panic Bunker"
|
||||
if (!config.sql_enabled)
|
||||
if (!CONFIG_GET(flag/sql_enabled))
|
||||
to_chat(usr, "<span class='adminnotice'>The Database is not enabled!</span>")
|
||||
return
|
||||
|
||||
config.panic_bunker = (!config.panic_bunker)
|
||||
var/new_pb = !CONFIG_GET(flag/panic_bunker)
|
||||
CONFIG_SET(flag/panic_bunker, new_pb)
|
||||
|
||||
log_admin("[key_name(usr)] has toggled the Panic Bunker, it is now [(config.panic_bunker?"on":"off")]")
|
||||
message_admins("[key_name_admin(usr)] has toggled the Panic Bunker, it is now [(config.panic_bunker?"enabled":"disabled")].")
|
||||
if (config.panic_bunker && (!SSdbcore || !SSdbcore.IsConnected()))
|
||||
log_admin("[key_name(usr)] has toggled the Panic Bunker, it is now [new_pb ? "on" : "off"]")
|
||||
message_admins("[key_name_admin(usr)] has toggled the Panic Bunker, it is now [new_pb ? "enabled" : "disabled"].")
|
||||
if (new_pb && !SSdbcore.Connect())
|
||||
message_admins("The Database is not connected! Panic bunker will not work until the connection is reestablished.")
|
||||
SSblackbox.add_details("admin_toggle","Toggle Panic Bunker|[config.panic_bunker]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
SSblackbox.add_details("admin_toggle","Toggle Panic Bunker|[new_pb]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user