Modify damage logging. (#5579)

This commit is contained in:
Leon Friedrich
2021-11-29 02:34:44 +13:00
committed by GitHub
parent b807250021
commit 0de4b7bc9f
28 changed files with 265 additions and 62 deletions

View File

@@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Server.Administration.Logs;
using Content.Server.Camera;
using Content.Server.Explosion.Components;
using Content.Shared.Acts;
using Content.Shared.Administration.Logs;
using Content.Shared.Interaction.Helpers;
using Content.Shared.Maps;
using Content.Shared.Physics;
@@ -48,6 +50,7 @@ namespace Content.Server.Explosion.EntitySystems
[Dependency] private readonly ActSystem _acts = default!;
[Dependency] private readonly EffectSystem _effects = default!;
[Dependency] private readonly TriggerSystem _triggers = default!;
[Dependency] private readonly AdminLogSystem _logSystem = default!;
private bool IgnoreExplosivePassable(IEntity e)
{
@@ -335,6 +338,9 @@ namespace Content.Server.Explosion.EntitySystems
return;
}
_logSystem.Add(LogType.Damaged, LogImpact.High ,
$"Spawned explosion at {epicenter} with range {devastationRange}/{heavyImpactRange}/{lightImpactRange}/{flashRange}");
var maxRange = MathHelper.Max(devastationRange, heavyImpactRange, lightImpactRange, 0);
var epicenterMapPos = epicenter.ToMapPos(EntityManager);
var boundingBox = new Box2(epicenterMapPos - new Vector2(maxRange, maxRange),