Further fixes.

This commit is contained in:
Ottermandias 2024-11-17 14:28:33 +01:00
parent e3a1ae6938
commit 5599f12753
3 changed files with 8 additions and 8 deletions

View file

@ -14,19 +14,19 @@ public sealed unsafe class CalculateHeight : FastHook<CalculateHeight.Delegate>
{
_collectionResolver = collectionResolver;
_metaState = metaState;
Task = hooks.CreateHook<Delegate>("Calculate Height", (nint)HeightContainer.MemberFunctionPointers.CalculateHeight, Detour,
Task = hooks.CreateHook<Delegate>("Calculate Height", (nint)Character.MemberFunctionPointers.CalculateHeight, Detour,
!HookOverrides.Instance.Meta.CalculateHeight);
}
public delegate ulong Delegate(HeightContainer* character);
public delegate ulong Delegate(Character* character);
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
private ulong Detour(HeightContainer* container)
private ulong Detour(Character* character)
{
var collection = _collectionResolver.IdentifyCollection((GameObject*)container->OwnerObject, true);
var collection = _collectionResolver.IdentifyCollection((GameObject*)character, true);
_metaState.RspCollection.Push(collection);
var ret = Task.Result.Original.Invoke(container);
Penumbra.Log.Excessive($"[Calculate Height] Invoked on {(nint)container:X} -> {ret}.");
var ret = Task.Result.Original.Invoke(character);
Penumbra.Log.Excessive($"[Calculate Height] Invoked on {(nint)character:X} -> {ret}.");
_metaState.RspCollection.Pop();
return ret;
}

View file

@ -240,7 +240,7 @@ public sealed unsafe class CollectionResolver(
}
// Only handle human models.
if (!IsModelHuman((uint)actor.AsCharacter->ModelCharaId))
if (!IsModelHuman((uint)actor.AsCharacter->ModelContainer.ModelCharaId))
return null;
if (actor.Customize->Data[0] == 0)

View file

@ -68,7 +68,7 @@ public class ResourceTree
Unsafe.AsPointer(ref character->DrawData.EquipmentModelIds[0]), 10),
_ => [],
};
ModelId = character->ModelCharaId;
ModelId = character->ModelContainer.ModelCharaId;
CustomizeData = character->DrawData.CustomizeData;
RaceCode = human != null ? (GenderRace)human->RaceSexId : GenderRace.Unknown;