From 1bdefba14cc3297ab477f3ee7c478e47439c64f8 Mon Sep 17 00:00:00 2001 From: Matthew Spencer Date: Sun, 27 Jan 2019 07:50:09 -0600 Subject: [PATCH] Also report stacktrace from OnEffectEnd, even if it's probably useless. --- source/OnEffectEndNullFix.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/OnEffectEndNullFix.cs b/source/OnEffectEndNullFix.cs index f6de682..d44d43e 100644 --- a/source/OnEffectEndNullFix.cs +++ b/source/OnEffectEndNullFix.cs @@ -5,6 +5,7 @@ using Harmony; using BattleTech; using System.Reflection; +using System.Diagnostics; using static BattletechPerformanceFix.Extensions; namespace BattletechPerformanceFix @@ -32,13 +33,13 @@ public static bool OnEffectEnd_Pre(StatisticEffect __instance, object ___target) var hasCollection = collection != null; if (!hasCollection) { - LogWarning($"OnEffectEnd was called with null statCollection for {__instance.id}"); + LogWarning($"OnEffectEnd was called with null statCollection for {__instance.id} from {new StackTrace(1).ToString()}"); // Taken from the base function directly. // Need to continue the effect chain as it updates pathing & FOW & other logic (___target as ICombatant)?.OnEffectEnd(__instance); } - + return hasCollection; }