Adds like 17 new logs (#5499)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Camera;
|
||||
using Content.Server.Projectiles.Components;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Damage;
|
||||
using JetBrains.Annotations;
|
||||
@@ -15,6 +17,7 @@ namespace Content.Server.Projectiles
|
||||
internal sealed class ProjectileSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -50,8 +53,11 @@ namespace Content.Server.Projectiles
|
||||
|
||||
if (!otherEntity.Deleted)
|
||||
{
|
||||
_damageableSystem.TryChangeDamage(otherEntity.Uid, component.Damage);
|
||||
var dmg = _damageableSystem.TryChangeDamage(otherEntity.Uid, component.Damage);
|
||||
component.DamagedEntity = true;
|
||||
|
||||
if (dmg is not null && EntityManager.TryGetEntity(component.Shooter, out var shooter))
|
||||
_adminLogSystem.Add(LogType.BulletHit, LogImpact.Low, $"Bullet shot by {shooter} hit {otherEntity}");
|
||||
// "DamagedEntity" is misleading. Hit entity may be more accurate, as the damage may have been resisted
|
||||
// by resistance sets.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user