mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Small pap resolving fixes.
This commit is contained in:
parent
cf79f47e08
commit
be84b36319
2 changed files with 9 additions and 9 deletions
|
|
@ -1,7 +1,5 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Dalamud.Hooking;
|
||||
using Dalamud.Logging;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||
using Penumbra.Collections;
|
||||
|
|
@ -10,7 +8,6 @@ namespace Penumbra.Interop.Resolver;
|
|||
|
||||
public unsafe partial class PathResolver
|
||||
{
|
||||
|
||||
// Probably used when the base idle animation gets loaded.
|
||||
// Make it aware of the correct collection to load the correct pap files.
|
||||
[Signature( "E8 ?? ?? ?? ?? BA ?? ?? ?? ?? 48 8B CF 44 8B C2 E8 ?? ?? ?? ?? 48 8B 05", DetourName = "CharacterBaseLoadAnimationDetour" )]
|
||||
|
|
@ -18,10 +15,11 @@ public unsafe partial class PathResolver
|
|||
|
||||
private ModCollection? _animationLoadCollection;
|
||||
|
||||
private void CharacterBaseLoadAnimationDetour( IntPtr address )
|
||||
private void CharacterBaseLoadAnimationDetour( IntPtr drawObject )
|
||||
{
|
||||
_animationLoadCollection = _lastCreatedCollection ?? IdentifyCollection( ( GameObject* )address );
|
||||
CharacterBaseLoadAnimationHook!.Original( address );
|
||||
_animationLoadCollection = _lastCreatedCollection
|
||||
?? ( FindParent( drawObject, out var collection ) != null ? collection : Penumbra.CollectionManager.Default );
|
||||
CharacterBaseLoadAnimationHook!.Original( drawObject );
|
||||
_animationLoadCollection = null;
|
||||
}
|
||||
|
||||
|
|
@ -31,9 +29,11 @@ public unsafe partial class PathResolver
|
|||
|
||||
[Signature( "E8 ?? ?? ?? ?? 0F 10 00 0F 11 06", DetourName = "RandomPapDetour" )]
|
||||
public Hook< PapLoadFunction >? RandomPapHook;
|
||||
|
||||
private void RandomPapDetour( IntPtr drawObject, IntPtr a2, uint a3, IntPtr a4, uint a5, uint a6, uint a7 )
|
||||
{
|
||||
_animationLoadCollection = _lastCreatedCollection ?? IdentifyCollection( ( GameObject* )drawObject );
|
||||
_animationLoadCollection = _lastCreatedCollection
|
||||
?? ( FindParent( drawObject, out var collection ) != null ? collection : Penumbra.CollectionManager.Default );
|
||||
RandomPapHook!.Original( drawObject, a2, a3, a4, a5, a6, a7 );
|
||||
_animationLoadCollection = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,10 +72,10 @@ public partial class PathResolver : IDisposable
|
|||
return false;
|
||||
}
|
||||
|
||||
private bool HandlePapFile( ResourceType type, Utf8GamePath gamePath, out ModCollection? collection )
|
||||
private bool HandlePapFile( ResourceType type, Utf8GamePath _, out ModCollection? collection )
|
||||
{
|
||||
if( type is ResourceType.Pap or ResourceType.Tmb
|
||||
&& _animationLoadCollection != null)
|
||||
&& _animationLoadCollection != null )
|
||||
{
|
||||
collection = _animationLoadCollection;
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue