Skip to content

Commit

Permalink
Improved performance with much better reference resolution. Thanks @N…
Browse files Browse the repository at this point in the history
  • Loading branch information
kjack9 committed May 8, 2021
1 parent 0865f16 commit e27f51f
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions BookSmart/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,7 @@ public static List<string> CreateQuestBookCache(IPatcherState<ISkyrimMod, ISkyri
if (alias.CreateReferenceToObject is not null)
{
// try to resolve the quest object to the actual records
if (!alias.CreateReferenceToObject.Object.TryResolve(state.LinkCache, out var questObject))
{
Console.WriteLine($"WARNING: Referenced object '{alias.CreateReferenceToObject.Object}' in Quest '{quest.FormKey} could not be resolved.");
}
else if (questObject is IBookGetter)
if (alias.CreateReferenceToObject.Object.TryResolve<IBookGetter>(state.LinkCache, out var questObject))
{
//Console.WriteLine($"{quest.FormKey}: '{questObject.FormKey}' is used in quest '{quest.Name}'");
questBookCache.Add(questObject.FormKey.ToString());
Expand All @@ -153,11 +149,7 @@ public static List<string> CreateQuestBookCache(IPatcherState<ISkyrimMod, ISkyri
{
// try to resolve the quest object to the actual records
// item.item.item.item
if (!item.Item.Item.TryResolve(state.LinkCache, out var questObject))
{
Console.WriteLine($"WARNING: Referenced object '{item.Item.Item}' in Quest '{quest.FormKey} could not be resolved.");
}
else if (questObject is IBookGetter)
if (item.Item.Item.TryResolve<IBookGetter>(state.LinkCache, out var questObject))
{
//Console.WriteLine($"{quest.FormKey}: '{questObject.FormKey}' is used in quest '{quest.Name}'");
questBookCache.Add(questObject.FormKey.ToString());
Expand Down

0 comments on commit e27f51f

Please sign in to comment.