]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add cvar to disable round end pvs overrides (#29151)
authorDrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
Tue, 18 Jun 2024 12:00:29 +0000 (05:00 -0700)
committerGitHub <noreply@github.com>
Tue, 18 Jun 2024 12:00:29 +0000 (22:00 +1000)
Content.Server/GameTicking/GameTicker.RoundFlow.cs
Content.Shared/CCVar/CCVars.cs

index 98fcc6441045da734b30ccb63f3d4ff26ad04d34..eed120dc4e8a5daed1c9ecb28815e185320a296d 100644 (file)
@@ -358,6 +358,7 @@ namespace Content.Server.GameTicking
             var listOfPlayerInfo = new List<RoundEndMessageEvent.RoundEndPlayerInfo>();
             // Grab the great big book of all the Minds, we'll need them for this.
             var allMinds = EntityQueryEnumerator<MindComponent>();
+            var pvsOverride = _configurationManager.GetCVar(CCVars.RoundEndPVSOverrides);
             while (allMinds.MoveNext(out var mindId, out var mind))
             {
                 // TODO don't list redundant observer roles?
@@ -388,7 +389,7 @@ namespace Content.Server.GameTicking
                 else if (mind.CurrentEntity != null && TryName(mind.CurrentEntity.Value, out var icName))
                     playerIcName = icName;
 
-                if (TryGetEntity(mind.OriginalOwnedEntity, out var entity))
+                if (TryGetEntity(mind.OriginalOwnedEntity, out var entity) && pvsOverride)
                 {
                     _pvsOverride.AddGlobalOverride(GetNetEntity(entity.Value), recursive: true);
                 }
index 7cc1b341a97533b494289ea58e586e4f0c2025df..26410db8464e045d012aabbd8ef4aec3e54da287 100644 (file)
@@ -432,6 +432,14 @@ namespace Content.Shared.CCVar
         public static readonly CVarDef<string> RoundEndSoundCollection =
             CVarDef.Create("game.round_end_sound_collection", "RoundEnd", CVar.SERVERONLY);
 
+        /// <summary>
+        /// Whether or not to add every player as a global override to PVS at round end.
+        /// This will allow all players to see their clothing in the round screen player list screen,
+        /// but may cause lag during round end with very high player counts.
+        /// </summary>
+        public static readonly CVarDef<bool> RoundEndPVSOverrides =
+            CVarDef.Create("game.round_end_pvs_overrides", true, CVar.SERVERONLY);
+
         /*
          * Discord
          */