]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make DamageOtherOnHitSystem only flash an entity red if damage was dealt (#23612)
authorDrSmugleaf <DrSmugleaf@users.noreply.github.com>
Sat, 6 Jan 2024 12:13:01 +0000 (04:13 -0800)
committerGitHub <noreply@github.com>
Sat, 6 Jan 2024 12:13:01 +0000 (23:13 +1100)
Content.Server/Damage/Systems/DamageOtherOnHitSystem.cs

index 13fa3d246e346cd1fcfdcf520008842655f4f978..c7600ec2212f86c7a9c578aebded8d6929b576a0 100644 (file)
@@ -10,7 +10,6 @@ using Content.Shared.Effects;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Throwing;
 using Robust.Shared.Physics.Components;
-using Robust.Shared.Physics.Systems;
 using Robust.Shared.Player;
 
 namespace Content.Server.Damage.Systems
@@ -39,7 +38,11 @@ namespace Content.Server.Damage.Systems
             if (dmg != null && HasComp<MobStateComponent>(args.Target))
                 _adminLogger.Add(LogType.ThrowHit, $"{ToPrettyString(args.Target):target} received {dmg.Total:damage} damage from collision");
 
-            _color.RaiseEffect(Color.Red, new List<EntityUid>() { args.Target }, Filter.Pvs(args.Target, entityManager: EntityManager));
+            if (dmg is { Empty: false })
+            {
+                _color.RaiseEffect(Color.Red, new List<EntityUid>() { args.Target }, Filter.Pvs(args.Target, entityManager: EntityManager));
+            }
+
             _guns.PlayImpactSound(args.Target, dmg, null, false);
             if (TryComp<PhysicsComponent>(uid, out var body) && body.LinearVelocity.LengthSquared() > 0f)
             {