Change Eqp hook to not need eqp files anymore.

This commit is contained in:
Ottermandias 2024-06-15 11:37:39 +02:00
parent e33512cf7f
commit ad0c64d4ac
6 changed files with 19 additions and 23 deletions

View file

@ -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
{