Make tests automatically reset modified cvars (#28219)

* Make tests automatically reset modified cvars

* Fix bad return

* A

* Try Fix tests

* clarify comment

* update eng
This commit is contained in:
Leon Friedrich
2024-05-31 14:44:35 +12:00
committed by GitHub
parent 54337911d3
commit 27e63f5919
6 changed files with 91 additions and 2 deletions

View File

@@ -292,6 +292,19 @@ namespace Content.Server.Administration.Systems
: _adminManager.ActiveAdmins;
var hasAdmins = admins.Any();
// TODO Fix order dependent Cvars
// Please for the sake of my sanity don't make cvars & order dependent.
// Just make a bool field on the system instead of having some cvars automatically modify other cvars.
//
// I.e., this:
// /sudo cvar game.panic_bunker.enabled true
// /sudo cvar game.panic_bunker.disable_with_admins true
// and this:
// /sudo cvar game.panic_bunker.disable_with_admins true
// /sudo cvar game.panic_bunker.enabled true
//
// should have the same effect, but currently setting the disable_with_admins can modify enabled.
if (hasAdmins && PanicBunker.DisableWithAdmins)
{
_config.SetCVar(CCVars.PanicBunkerEnabled, false);