mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-23 08:17:59 +01:00
Change Eqp hook to not need eqp files anymore.
This commit is contained in:
parent
e33512cf7f
commit
ad0c64d4ac
6 changed files with 19 additions and 23 deletions
|
|
@ -19,11 +19,10 @@ public unsafe class EqpHook : FastHook<EqpHook.Delegate>
|
|||
|
||||
private void Detour(CharacterUtility* utility, EqpEntry* flags, CharacterArmor* armor)
|
||||
{
|
||||
if (_metaState.EqpCollection.Valid)
|
||||
if (_metaState.EqpCollection is { Valid: true, ModCollection.MetaCache: { } cache })
|
||||
{
|
||||
using var eqp = _metaState.ResolveEqpData(_metaState.EqpCollection.ModCollection);
|
||||
Task.Result.Original(utility, flags, armor);
|
||||
*flags = _metaState.EqpCollection.ModCollection.ApplyGlobalEqp(*flags, armor);
|
||||
*flags = cache.Eqp.GetValues(armor);
|
||||
*flags = cache.GlobalEqp.Apply(*flags, armor);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ public sealed unsafe class MetaState : IDisposable
|
|||
|
||||
public ResolveData CustomizeChangeCollection = ResolveData.Invalid;
|
||||
public ResolveData EqpCollection = ResolveData.Invalid;
|
||||
public ResolveData GmpCollection = ResolveData.Invalid;
|
||||
public PrimaryId UndividedGmpId = 0;
|
||||
|
||||
private ResolveData _lastCreatedCollection = ResolveData.Invalid;
|
||||
private DisposableContainer _characterBaseCreateMetaChanges = DisposableContainer.Empty;
|
||||
|
|
@ -93,9 +95,6 @@ public sealed unsafe class MetaState : IDisposable
|
|||
_ => DisposableContainer.Empty,
|
||||
};
|
||||
|
||||
public MetaList.MetaReverter ResolveEqpData(ModCollection collection)
|
||||
=> collection.TemporarilySetEqpFile(_characterUtility);
|
||||
|
||||
public MetaList.MetaReverter ResolveGmpData(ModCollection collection)
|
||||
=> collection.TemporarilySetGmpFile(_characterUtility);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue