Update ChemicalReaction and ReagentEffect logs. (#23649)

* Update ChemicalReaction and ReagentEffect logs.

* Updated explosion log as well, and small cleanup.
This commit is contained in:
Trevor Day
2024-01-07 11:23:18 -08:00
committed by GitHub
parent c6e829ca6e
commit aa7fcb19ec
2 changed files with 11 additions and 8 deletions

View File

@@ -9,6 +9,7 @@ using Robust.Shared.Utility;
using System.Collections.Frozen;
using System.Linq;
namespace Content.Shared.Chemistry.Reaction
{
public sealed class ChemicalReactionSystem : EntitySystem
@@ -21,6 +22,7 @@ namespace Content.Shared.Chemistry.Reaction
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
/// <summary>
/// A cache of all reactions indexed by at most ONE of their required reactants.
@@ -199,7 +201,8 @@ namespace Content.Shared.Chemistry.Reaction
reagent,
unitReactions, EntityManager, null, 1f);
var coordinates = Transform(soln).Coordinates;
var coordinates = _transformSystem.GetMapCoordinates(soln);
_adminLogger.Add(LogType.ChemicalReaction, reaction.Impact,
$"Chemical reaction {reaction.ID:reaction} occurred with strength {unitReactions:strength} on entity {ToPrettyString(soln):metabolizer} at {coordinates}");
@@ -212,7 +215,7 @@ namespace Content.Shared.Chemistry.Reaction
{
var entity = args.SolutionEntity;
_adminLogger.Add(LogType.ReagentEffect, effect.LogImpact,
$"Reaction effect {effect.GetType().Name:effect} of reaction ${reaction.ID:reaction} applied on entity {ToPrettyString(entity):entity} at {Transform(entity).Coordinates:coordinates}");
$"Reaction effect {effect.GetType().Name:effect} of reaction {reaction.ID:reaction} applied on entity {ToPrettyString(entity):entity} at {coordinates}");
}
effect.Effect(args);