]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Undo effect logging changes (#40919)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Wed, 15 Oct 2025 06:15:05 +0000 (19:15 +1300)
committerGitHub <noreply@github.com>
Wed, 15 Oct 2025 06:15:05 +0000 (06:15 +0000)
* Undo effect logging changes

* remove ShouldLog

Content.Shared/EntityEffects/Effects/Atmos/FlammableEntityEffect.cs
Content.Shared/EntityEffects/Effects/Atmos/IgniteEntityEffect.cs
Content.Shared/EntityEffects/Effects/Solution/AreaReactionEntityEffect.cs
Content.Shared/EntityEffects/Effects/Transform/EmpEntityEffectSystem.cs
Content.Shared/EntityEffects/Effects/Transform/ExplosionEntityEffect.cs
Content.Shared/EntityEffects/SharedEntityEffectsSystem.cs

index f08b609407d86f3ec66c2122da1307e6826df3b1..563201a40ff35e8416a022d8199fd945289c098c 100644 (file)
@@ -1,4 +1,5 @@
-using Robust.Shared.Prototypes;
+using Content.Shared.Database;
+using Robust.Shared.Prototypes;
 
 namespace Content.Shared.EntityEffects.Effects.Atmos;
 
@@ -24,5 +25,5 @@ public sealed partial class Flammable : EntityEffectBase<Flammable>
     public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
         => Loc.GetString("entity-effect-guidebook-flammable-reaction", ("chance", Probability));
 
-    public override bool ShouldLog => true;
+    public override LogImpact? Impact => LogImpact.Low;
 }
index e10aaf3cd1c0553967824302b1b7ce24345d7650..7ca93e7c1809bb7c9024e44f19724ba54e79753c 100644 (file)
@@ -12,7 +12,5 @@ public sealed partial class Ignite : EntityEffectBase<Ignite>
     public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
         Loc.GetString("entity-effect-guidebook-ignite", ("chance", Probability));
 
-    public override bool ShouldLog => true;
-
-    public override LogImpact LogImpact => LogImpact.Medium;
+    public override LogImpact? Impact => LogImpact.Medium;
 }
index 5fbe9483600070e537942fbd148abf1fb9f03e45..13175cfed1cb35ed4922dd3eefb39e311c7b80f1 100644 (file)
@@ -33,7 +33,5 @@ public sealed partial class AreaReactionEffect : EntityEffectBase<AreaReactionEf
             ("duration", Duration)
         );
 
-    public override bool ShouldLog => true;
-
-    public override LogImpact LogImpact => LogImpact.High;
+    public override LogImpact? Impact => LogImpact.High;
 }
index c4768dcd11ee6db123225d2677d2aabedaed80e2..2cbb6d6dad0ff4a66138fa0b7757e95a30beb897 100644 (file)
@@ -52,7 +52,5 @@ public sealed partial class Emp : EntityEffectBase<Emp>
     public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
         => Loc.GetString("entity-effect-guidebook-emp-reaction-effect", ("chance", Probability));
 
-    public override bool ShouldLog => true;
-
-    public override LogImpact LogImpact => LogImpact.Medium;
+    public override LogImpact? Impact => LogImpact.Medium;
 }
index 762ef24141a174deacb63bbf973bd5972e2ce786..95fd98294cf0598fa77f08a221a061184fabf073 100644 (file)
@@ -52,7 +52,5 @@ public sealed partial class ExplosionEffect : EntityEffectBase<ExplosionEffect>
     public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
         => Loc.GetString("entity-effect-guidebook-explosion-reaction-effect", ("chance", Probability));
 
-    public override bool ShouldLog => true;
-
-    public override LogImpact LogImpact => LogImpact.High;
+    public override LogImpact? Impact => LogImpact.High;
 }
index 6245fc08271cb1bd7f563d2c128680b2e5ec79f6..1122f75f937f584ac2b6a3e3f581352cdf00413f 100644 (file)
@@ -1,10 +1,9 @@
-using System.Linq;
+using System.Diagnostics.CodeAnalysis;
 using Content.Shared.Administration.Logs;
 using Content.Shared.Chemistry;
 using Content.Shared.Chemistry.Reaction;
 using Content.Shared.Database;
 using Content.Shared.EntityConditions;
-using Content.Shared.Localizations;
 using Content.Shared.Random.Helpers;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
@@ -119,11 +118,11 @@ public sealed partial class SharedEntityEffectsSystem : EntitySystem, IEntityEff
         if (!effect.Scaling)
             scale = Math.Min(scale, 1f);
 
-        if (effect.ShouldLog)
+        if (effect.Impact is {} level)
         {
             _adminLog.Add(
-                LogType.EntityEffect,
-                effect.LogImpact,
+                effect.LogType,
+                level,
                 $"Entity effect {effect.GetType().Name:effect}"
                 + $" applied on entity {target:entity}"
                 + $" at {Transform(target).Coordinates:coordinates}"
@@ -213,22 +212,16 @@ public abstract partial class EntityEffect
     [DataField]
     public float Probability = 1.0f;
 
-    /// <summary>
-    /// The description of this entity effect that shows in guidebooks.
-    /// </summary>
     public virtual string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => null;
 
     /// <summary>
-    /// Whether this effect should be logged in admin logs.
+    /// If this effect is logged, how important is the log?
     /// </summary>
     [ViewVariables]
-    public virtual bool ShouldLog => true;
+    public virtual LogImpact? Impact => null;
 
-    /// <summary>
-    /// If this effect is logged, how important is the log?
-    /// </summary>
     [ViewVariables]
-    public virtual LogImpact LogImpact => LogImpact.Low;
+    public virtual LogType LogType => LogType.EntityEffect;
 }
 
 /// <summary>