Skip to content

Commit

Permalink
Also report stacktrace from OnEffectEnd, even if it's probably useless.
Browse files Browse the repository at this point in the history
  • Loading branch information
m22spencer committed Jan 27, 2019
1 parent ca60a0f commit 1bdefba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/OnEffectEndNullFix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Harmony;
using BattleTech;
using System.Reflection;
using System.Diagnostics;
using static BattletechPerformanceFix.Extensions;

namespace BattletechPerformanceFix
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 1bdefba

Please sign in to comment.