diff --git a/Penumbra/Interop/Resolver/PathResolver.Animation.cs b/Penumbra/Interop/Resolver/PathResolver.Animation.cs index 53cb7be5..1d51b8df 100644 --- a/Penumbra/Interop/Resolver/PathResolver.Animation.cs +++ b/Penumbra/Interop/Resolver/PathResolver.Animation.cs @@ -73,6 +73,7 @@ public unsafe partial class PathResolver return ret; } + // Unknown what exactly this is but it seems to load a bunch of paps. public delegate void LoadSomePap( IntPtr a1, int a2, IntPtr a3, int a4 ); [Signature( "48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 41 56 41 57 48 83 EC ?? 41 8B D9 89 51" )] @@ -93,4 +94,16 @@ public unsafe partial class PathResolver LoadSomePapHook!.Original( a1, a2, a3, a4 ); _animationLoadCollection = last; } + + // Seems to load character actions when zoning or changing class, maybe. + [Signature( "E8 ?? ?? ?? ?? C6 83 ?? ?? ?? ?? ?? 8B 8E", DetourName = nameof( SomeActionLoadDetour ) )] + public Hook< CharacterBaseDestructorDelegate >? SomeActionLoadHook; + + private void SomeActionLoadDetour( IntPtr gameObject ) + { + var last = _animationLoadCollection; + _animationLoadCollection = IdentifyCollection( ( GameObject* )gameObject ); + SomeActionLoadHook!.Original( gameObject ); + _animationLoadCollection = last; + } } \ No newline at end of file diff --git a/Penumbra/Interop/Resolver/PathResolver.Data.cs b/Penumbra/Interop/Resolver/PathResolver.Data.cs index 28241e9c..7f12e600 100644 --- a/Penumbra/Interop/Resolver/PathResolver.Data.cs +++ b/Penumbra/Interop/Resolver/PathResolver.Data.cs @@ -94,6 +94,7 @@ public unsafe partial class PathResolver CharacterBaseLoadAnimationHook?.Enable(); LoadSomeAvfxHook?.Enable(); LoadSomePapHook?.Enable(); + SomeActionLoadHook?.Enable(); } private void DisableDataHooks() @@ -107,6 +108,7 @@ public unsafe partial class PathResolver CharacterBaseLoadAnimationHook?.Disable(); LoadSomeAvfxHook?.Disable(); LoadSomePapHook?.Disable(); + SomeActionLoadHook?.Disable(); } private void DisposeDataHooks() @@ -119,6 +121,7 @@ public unsafe partial class PathResolver CharacterBaseLoadAnimationHook?.Dispose(); LoadSomeAvfxHook?.Dispose(); LoadSomePapHook?.Dispose(); + SomeActionLoadHook?.Dispose(); } // This map links DrawObjects directly to Actors (by ObjectTable index) and their collections. diff --git a/Penumbra/Interop/Resolver/PathResolver.cs b/Penumbra/Interop/Resolver/PathResolver.cs index ab4d208b..9c8111b7 100644 --- a/Penumbra/Interop/Resolver/PathResolver.cs +++ b/Penumbra/Interop/Resolver/PathResolver.cs @@ -76,9 +76,6 @@ public partial class PathResolver : IDisposable private bool HandleAnimationFile( ResourceType type, Utf8GamePath _, [NotNullWhen(true)] out ModCollection? collection ) { - if( type == ResourceType.Pap && _.Path.EndsWith( '0', '1', '0', '.', 'p', 'a', 'p' ) ) - PluginLog.Information( $"PAPPITY PAP {_}" ); - if( _animationLoadCollection != null ) { switch( type )