From 748c45a46173d87bca8a68ffd6fa60b9b8034449 Mon Sep 17 00:00:00 2001 From: Adam <893184+NotAdam@users.noreply.github.com> Date: Sat, 26 Dec 2020 11:54:33 +1100 Subject: [PATCH] actually clear swapped files when toggling mods... --- Penumbra/Mods/ModManager.cs | 1 + Penumbra/ResourceLoader.cs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Penumbra/Mods/ModManager.cs b/Penumbra/Mods/ModManager.cs index 85260ad4..55e14e42 100644 --- a/Penumbra/Mods/ModManager.cs +++ b/Penumbra/Mods/ModManager.cs @@ -55,6 +55,7 @@ namespace Penumbra.Mods public void CalculateEffectiveFileList() { ResolvedFiles.Clear(); + SwappedFiles.Clear(); var registeredFiles = new Dictionary< string, string >(); diff --git a/Penumbra/ResourceLoader.cs b/Penumbra/ResourceLoader.cs index 0fa13057..ee4ccdb5 100644 --- a/Penumbra/ResourceLoader.cs +++ b/Penumbra/ResourceLoader.cs @@ -165,7 +165,7 @@ namespace Penumbra var path = candidate?.FullName ?? swappedFilePath; // path must be < 260 because statically defined array length :( - if( path == null || path.Length < 260 ) + if( path == null || path.Length >= 260 ) { return CallOriginalHandler( isSync, pFileManager, pCategoryId, pResourceType, pResourceHash, pPath, pUnknown, isUnknown ); } @@ -181,6 +181,10 @@ namespace Penumbra Crc32.Update( utfPath ); *pResourceHash = Crc32.Checksum; +#if DEBUG + PluginLog.Log( "[GetResourceHandler] resolved {GamePath} to {NewPath}", gameFsPath, path ); +#endif + return CallOriginalHandler( isSync, pFileManager, pCategoryId, pResourceType, pResourceHash, pPath, pUnknown, isUnknown ); }