mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 20:54:16 +01:00
Maybe fix AtchCaller crashes.
This commit is contained in:
parent
c3b2443ab5
commit
3b54485127
2 changed files with 5 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ public unsafe class AtchCallerHook1 : FastHook<AtchCallerHook1.Delegate>, IDispo
|
||||||
|
|
||||||
private void Detour(DrawObjectData* data, uint slot, nint unk, Model playerModel)
|
private void Detour(DrawObjectData* data, uint slot, nint unk, Model playerModel)
|
||||||
{
|
{
|
||||||
var collection = _collectionResolver.IdentifyCollection(playerModel.AsDrawObject, true);
|
var collection = playerModel.Valid ? _collectionResolver.IdentifyCollection(playerModel.AsDrawObject, true) : _collectionResolver.DefaultCollection;
|
||||||
_metaState.AtchCollection.Push(collection);
|
_metaState.AtchCollection.Push(collection);
|
||||||
Task.Result.Original(data, slot, unk, playerModel);
|
Task.Result.Original(data, slot, unk, playerModel);
|
||||||
_metaState.AtchCollection.Pop();
|
_metaState.AtchCollection.Pop();
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,10 @@ public sealed unsafe class CollectionResolver(
|
||||||
return IdentifyCollection(obj, useCache);
|
return IdentifyCollection(obj, useCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary> Get the default collection. </summary>
|
||||||
|
public ResolveData DefaultCollection
|
||||||
|
=> collectionManager.Active.Default.ToResolveData();
|
||||||
|
|
||||||
/// <summary> Return whether the given ModelChara id refers to a human-type model. </summary>
|
/// <summary> Return whether the given ModelChara id refers to a human-type model. </summary>
|
||||||
public bool IsModelHuman(uint modelCharaId)
|
public bool IsModelHuman(uint modelCharaId)
|
||||||
=> humanModels.IsHuman(modelCharaId);
|
=> humanModels.IsHuman(modelCharaId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue