Stop replacing UI hashes to test if that fixes crashes.

This commit is contained in:
Ottermandias 2022-09-04 02:51:42 +02:00
parent ae842720ee
commit 9ce948e238
2 changed files with 9 additions and 4 deletions

View file

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection.Metadata;
using Dalamud.Hooking; using Dalamud.Hooking;
using Dalamud.Logging; using Dalamud.Logging;
using Dalamud.Utility.Signatures; using Dalamud.Utility.Signatures;

View file

@ -97,9 +97,15 @@ public unsafe partial class ResourceLoader
return retUnmodified; return retUnmodified;
} }
// Replace the hash and path with the correct one for the replacement. // Replace the hash and path with the correct one for the replacement,
*resourceHash = ComputeHash( resolvedPath.Value.InternalName, pGetResParams ); // but only for non-UI files. UI files can not reasonably be loaded multiple times at once,
path = resolvedPath.Value.InternalName.Path; // 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 ); var retModified = CallOriginalHandler( isSync, resourceManager, categoryId, resourceType, resourceHash, path, pGetResParams, isUnk );
ResourceLoaded?.Invoke( ( Structs.ResourceHandle* )retModified, gamePath, resolvedPath.Value, data ); ResourceLoaded?.Invoke( ( Structs.ResourceHandle* )retModified, gamePath, resolvedPath.Value, data );
return retModified; return retModified;