Log a lot less reagent effects (#5572)
This commit is contained in:
@@ -31,6 +31,15 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
[DataField("probability")]
|
||||
public float Probability = 1.0f;
|
||||
|
||||
[DataField("logImpact")]
|
||||
public virtual LogImpact LogImpact { get; } = LogImpact.Low;
|
||||
|
||||
/// <summary>
|
||||
/// Should this reagent effect log at all?
|
||||
/// </summary>
|
||||
[DataField("shouldLog")]
|
||||
public virtual bool ShouldLog { get; } = false;
|
||||
|
||||
public abstract void Effect(ReagentEffectArgs args);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,10 +120,13 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
if (!plantMetabolizable.ShouldApply(args, random))
|
||||
continue;
|
||||
|
||||
var entity = entMan.GetEntity(args.SolutionEntity);
|
||||
EntitySystem.Get<SharedAdminLogSystem>().Add(LogType.ReagentEffect, LogImpact.Low,
|
||||
$"Plant metabolism effect {plantMetabolizable.GetType().Name:effect} of reagent {ID} applied on entity {entity} at {entity.Transform.Coordinates}");
|
||||
plantMetabolizable.Effect(args);
|
||||
if (plantMetabolizable.ShouldLog)
|
||||
{
|
||||
var entity = entMan.GetEntity(args.SolutionEntity);
|
||||
EntitySystem.Get<SharedAdminLogSystem>().Add(LogType.ReagentEffect, plantMetabolizable.LogImpact,
|
||||
$"Plant metabolism effect {plantMetabolizable.GetType().Name:effect} of reagent {ID} applied on entity {entity} at {entity.Transform.Coordinates}");
|
||||
plantMetabolizable.Effect(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user