Skip to content

Commit

Permalink
Added even more logging to FetchCriticalEffects related code.
Browse files Browse the repository at this point in the history
  • Loading branch information
CptMoore committed Jul 1, 2023
1 parent 8d535ab commit dc49e24
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/Features/CriticalEffects/CriticalEffects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ internal CriticalEffects(MechComponent component)
{
_criticals = new(component);
Effects = FetchCriticalEffects();
if (Effects != null)
{
// TODO move back to trace
Log.Main.Debug?.Log($"Found matching {Effects.GetType()}");
}
}

private bool IsLocationDestroyed => actor.StructureForLocation(component.Location) <= 0f;
Expand All @@ -29,6 +34,8 @@ internal CriticalEffects(MechComponent component)
private CriticalEffectsCustom? FetchCriticalEffects()
{
var customs = component.componentDef.GetComponents<CriticalEffectsCustom>().ToList();
// TODO move back to trace
Log.Main.Debug?.Log($"Finding CriticalEffects custom for {component.componentDef.Description.Id} on Actor Id={actor.Description.Id} type={actor.GetType()}");

if (actor is Mech mech)
{
Expand All @@ -41,7 +48,7 @@ internal CriticalEffects(MechComponent component)
foreach (var custom in customs.OfType<MechCriticalEffectsCustom>())
{
// TODO move back to trace
Log.Main.Debug?.Log($"Found custom.UnitTypes=[{string.Join(",", custom.UnitTypes)}] on ComponentDefId={component.componentDef.Description.Id}");
Log.Main.Debug?.Log($"Found custom.UnitTypes=[{string.Join(",", custom.UnitTypes)}]");
if (custom.UnitTypes.All(t => unitTypes.Contains(t)))
{
return custom;
Expand Down

0 comments on commit dc49e24

Please sign in to comment.