diff --git a/Penumbra/Interop/Resolver/PathResolver.DrawObjectState.cs b/Penumbra/Interop/Resolver/PathResolver.DrawObjectState.cs index 47cd5e6d..18e04041 100644 --- a/Penumbra/Interop/Resolver/PathResolver.DrawObjectState.cs +++ b/Penumbra/Interop/Resolver/PathResolver.DrawObjectState.cs @@ -144,10 +144,8 @@ public unsafe partial class PathResolver _lastCreatedCollection = IdentifyCollection( LastGameObject, false ); // Change the transparent or 1.0 Decal if necessary. var decal = new CharacterUtility.DecalReverter( _lastCreatedCollection.ModCollection, UsesDecal( a, c ) ); - // Change the rsp parameters if necessary. - meta = new DisposableContainer( _lastCreatedCollection.ModCollection != Penumbra.CollectionManager.Default - ? _lastCreatedCollection.ModCollection.TemporarilySetCmpFile() - : null, decal ); + // Change the rsp parameters. + meta = new DisposableContainer( _lastCreatedCollection.ModCollection.TemporarilySetCmpFile(), decal ); try { var modelPtr = &a; @@ -160,16 +158,19 @@ public unsafe partial class PathResolver } var ret = _characterBaseCreateHook.Original( a, b, c, d ); - using( meta ) + try { if( LastGameObject != null && ret != IntPtr.Zero ) { _drawObjectToObject[ ret ] = ( _lastCreatedCollection!, LastGameObject->ObjectIndex ); CreatedCharacterBase?.Invoke( ( IntPtr )LastGameObject, _lastCreatedCollection!.ModCollection.Name, ret ); } - - return ret; } + finally + { + meta.Dispose(); + } + return ret; } // Check the customize array for the FaceCustomization byte and the last bit of that. diff --git a/Penumbra/Interop/Resolver/PathResolver.Meta.cs b/Penumbra/Interop/Resolver/PathResolver.Meta.cs index dc1e46d2..a15db301 100644 --- a/Penumbra/Interop/Resolver/PathResolver.Meta.cs +++ b/Penumbra/Interop/Resolver/PathResolver.Meta.cs @@ -188,7 +188,9 @@ public unsafe partial class PathResolver var resolveData = GetResolveData( human ); using var cmp = resolveData.ModCollection.TemporarilySetCmpFile(); using var decals = new CharacterUtility.DecalReverter( resolveData.ModCollection, DrawObjectState.UsesDecal( 0, data ) ); - return _changeCustomize.Original( human, data, skipEquipment ); + var ret = _changeCustomize.Original( human, data, skipEquipment ); + _inChangeCustomize = false; + return ret; } public static DisposableContainer ResolveEqdpData( ModCollection collection, GenderRace race, bool equipment, bool accessory )