mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Fix incorrectly disposed VFX.
This commit is contained in:
parent
8ecf7e2381
commit
f17e9be824
2 changed files with 44 additions and 34 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using Dalamud.Hooking;
|
using Dalamud.Hooking;
|
||||||
|
using Dalamud.Logging;
|
||||||
using Dalamud.Utility.Signatures;
|
using Dalamud.Utility.Signatures;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||||
using Penumbra.Collections;
|
using Penumbra.Collections;
|
||||||
|
|
@ -59,16 +60,16 @@ public unsafe partial class PathResolver
|
||||||
_animationLoadCollection = last;
|
_animationLoadCollection = last;
|
||||||
}
|
}
|
||||||
|
|
||||||
public delegate ulong LoadSomeAvfx( uint a1, IntPtr gameObject, IntPtr gameObject2 );
|
public delegate ulong LoadSomeAvfx( uint a1, IntPtr gameObject, IntPtr gameObject2, float unk1, IntPtr unk2, IntPtr unk3 );
|
||||||
|
|
||||||
[Signature( "E8 ?? ?? ?? ?? 45 0F B6 F7", DetourName = nameof( LoadSomeAvfxDetour ) )]
|
[Signature( "E8 ?? ?? ?? ?? 45 0F B6 F7", DetourName = nameof( LoadSomeAvfxDetour ) )]
|
||||||
public Hook< LoadSomeAvfx >? LoadSomeAvfxHook;
|
public Hook< LoadSomeAvfx >? LoadSomeAvfxHook;
|
||||||
|
|
||||||
private ulong LoadSomeAvfxDetour( uint a1, IntPtr gameObject, IntPtr gameObject2 )
|
private ulong LoadSomeAvfxDetour( uint a1, IntPtr gameObject, IntPtr gameObject2, float unk1, IntPtr unk2, IntPtr unk3 )
|
||||||
{
|
{
|
||||||
var last = _animationLoadCollection;
|
var last = _animationLoadCollection;
|
||||||
_animationLoadCollection = IdentifyCollection( ( GameObject* )gameObject );
|
_animationLoadCollection = IdentifyCollection( ( GameObject* )gameObject );
|
||||||
var ret = LoadSomeAvfxHook!.Original( a1, gameObject, gameObject2 );
|
var ret = LoadSomeAvfxHook!.Original( a1, gameObject, gameObject2, unk1, unk2, unk3 );
|
||||||
_animationLoadCollection = last;
|
_animationLoadCollection = last;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Dalamud.Hooking;
|
using Dalamud.Hooking;
|
||||||
|
using Dalamud.Logging;
|
||||||
using Dalamud.Utility.Signatures;
|
using Dalamud.Utility.Signatures;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||||
|
|
@ -277,6 +278,8 @@ public unsafe partial class PathResolver
|
||||||
return Penumbra.CollectionManager.Default;
|
return Penumbra.CollectionManager.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
// Housing Retainers
|
// Housing Retainers
|
||||||
if( Penumbra.Config.UseDefaultCollectionForRetainers
|
if( Penumbra.Config.UseDefaultCollectionForRetainers
|
||||||
&& gameObject->ObjectKind == ( byte )ObjectKind.EventNpc
|
&& gameObject->ObjectKind == ( byte )ObjectKind.EventNpc
|
||||||
|
|
@ -312,6 +315,12 @@ public unsafe partial class PathResolver
|
||||||
// First check temporary character collections, then the own configuration.
|
// First check temporary character collections, then the own configuration.
|
||||||
return Penumbra.TempMods.Collections.TryGetValue( actualName, out var c ) ? c : Penumbra.CollectionManager.Character( actualName );
|
return Penumbra.TempMods.Collections.TryGetValue( actualName, out var c ) ? c : Penumbra.CollectionManager.Character( actualName );
|
||||||
}
|
}
|
||||||
|
catch( Exception e )
|
||||||
|
{
|
||||||
|
PluginLog.Error( $"Error identifying collection:\n{e}" );
|
||||||
|
return Penumbra.CollectionManager.Default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update collections linked to Game/DrawObjects due to a change in collection configuration.
|
// Update collections linked to Game/DrawObjects due to a change in collection configuration.
|
||||||
private void CheckCollections( ModCollection.Type type, ModCollection? _1, ModCollection? _2, string? name )
|
private void CheckCollections( ModCollection.Type type, ModCollection? _1, ModCollection? _2, string? name )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue