]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
make PacifiedComponent session specific (#38137)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Sat, 7 Jun 2025 21:37:13 +0000 (23:37 +0200)
committerGitHub <noreply@github.com>
Sat, 7 Jun 2025 21:37:13 +0000 (14:37 -0700)
Content.Shared/CombatMode/Pacification/PacifiedComponent.cs

index 96081e5dc67e73f07ce76ca6911ca9e16d086631..1ec48dc21310d6d0e4be89a696f04ed0af7aa16b 100644 (file)
@@ -17,33 +17,46 @@ namespace Content.Shared.CombatMode.Pacification;
 [Access(typeof(PacificationSystem))]
 public sealed partial class PacifiedComponent : Component
 {
+    /// <summary>
+    /// If true, this will prevent you from disarming opponents in combat.
+    /// </summary>
     [DataField]
     public bool DisallowDisarm = false;
 
     /// <summary>
-    ///  If true, this will disable combat entirely instead of only disallowing attacking living creatures and harmful things.
+    /// If true, this will disable combat entirely instead of only disallowing attacking living creatures and harmful things.
     /// </summary>
     [DataField]
     public bool DisallowAllCombat = false;
 
 
     /// <summary>
-    ///     When attempting attack against the same entity multiple times,
-    ///     don't spam popups every frame and instead have a cooldown.
+    /// When attempting attack against the same entity multiple times,
+    /// don't spam popups every frame and instead have a cooldown.
     /// </summary>
     [DataField]
     public TimeSpan PopupCooldown = TimeSpan.FromSeconds(3.0);
 
+    /// <summary>
+    /// Time at which the next popup can be shown.
+    /// </summary>
     [DataField]
     [AutoPausedField]
     public TimeSpan? NextPopupTime = null;
 
     /// <summary>
-    ///     The last entity attacked, used for popup purposes (avoid spam)
+    /// The last entity attacked, used for popup purposes (avoid spam)
     /// </summary>
     [DataField]
     public EntityUid? LastAttackedEntity = null;
 
+    /// <summary>
+    /// The alert to show to owners of this component.
+    /// </summary>
     [DataField]
     public ProtoId<AlertPrototype> PacifiedAlert = "Pacified";
+
+    // Prevent cheat clients from using this to identify thieves and players that cannot fight back.
+    // This should not matter for prediction reasons since it only blocks user input.
+    public override bool SendOnlyToOwner => true;
 }