diff --git a/Penumbra/Interop/Loader/ResourceLoader.Debug.cs b/Penumbra/Interop/Loader/ResourceLoader.Debug.cs index bdcf1220..02af20ce 100644 --- a/Penumbra/Interop/Loader/ResourceLoader.Debug.cs +++ b/Penumbra/Interop/Loader/ResourceLoader.Debug.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reflection.Metadata; using Dalamud.Hooking; using Dalamud.Logging; using Dalamud.Utility.Signatures; diff --git a/Penumbra/Interop/Loader/ResourceLoader.Replacement.cs b/Penumbra/Interop/Loader/ResourceLoader.Replacement.cs index c14a6720..ddbcf10f 100644 --- a/Penumbra/Interop/Loader/ResourceLoader.Replacement.cs +++ b/Penumbra/Interop/Loader/ResourceLoader.Replacement.cs @@ -97,9 +97,15 @@ public unsafe partial class ResourceLoader return retUnmodified; } - // Replace the hash and path with the correct one for the replacement. - *resourceHash = ComputeHash( resolvedPath.Value.InternalName, pGetResParams ); - path = resolvedPath.Value.InternalName.Path; + // Replace the hash and path with the correct one for the replacement, + // but only for non-UI files. UI files can not reasonably be loaded multiple times at once, + // and seem to cause concurrency problems if multiple UI parts use the same resource for different use-cases. + if( *categoryId != ResourceCategory.Ui ) + { + *resourceHash = ComputeHash( resolvedPath.Value.InternalName, pGetResParams ); + } + + path = resolvedPath.Value.InternalName.Path; var retModified = CallOriginalHandler( isSync, resourceManager, categoryId, resourceType, resourceHash, path, pGetResParams, isUnk ); ResourceLoaded?.Invoke( ( Structs.ResourceHandle* )retModified, gamePath, resolvedPath.Value, data ); return retModified;