From af170cdf7d42e98ede0dbeed986cc308dec6d2e1 Mon Sep 17 00:00:00 2001 From: Riot Date: Mon, 15 May 2023 10:52:52 +0200 Subject: [PATCH] fix: Prevent bloating of LoadedCustomRotations whenever a change was detected. --- RotationSolver/RotationHelper.cs | 3 +++ RotationSolver/Updaters/RotationUpdater.cs | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/RotationSolver/RotationHelper.cs b/RotationSolver/RotationHelper.cs index 38a0a4ae6..f42bb89a6 100644 --- a/RotationSolver/RotationHelper.cs +++ b/RotationSolver/RotationHelper.cs @@ -180,6 +180,9 @@ public static Assembly LoadFrom(string filePath) var loaded = new LoadedAssembly(); loaded.Path = filePath; loaded.LastModified = File.GetLastWriteTimeUtc(filePath).ToString(); + + var idx = LoadedCustomRotations.FindIndex(item => item.Path == loaded.Path); + if (idx != -1) LoadedCustomRotations.RemoveAt(idx); LoadedCustomRotations.Add(loaded); return assembly; diff --git a/RotationSolver/Updaters/RotationUpdater.cs b/RotationSolver/Updaters/RotationUpdater.cs index b5ac40ed3..8ec886068 100644 --- a/RotationSolver/Updaters/RotationUpdater.cs +++ b/RotationSolver/Updaters/RotationUpdater.cs @@ -1,4 +1,6 @@ using Dalamud.Logging; +using Lumina.Excel.GeneratedSheets; + using RotationSolver.Localization; using System.Text; @@ -222,6 +224,13 @@ public static void LocalRotationWatcher() } } + foreach (var item in RotationHelper.LoadedCustomRotations) + { + PluginLog.LogWarning("Loaded: " + item.Path); + } + + PluginLog.LogWarning("----------------------------"); + LastRunTime = DateTime.Now; }