mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-19 05:57:42 +01:00
Fix leaking a hook?
This commit is contained in:
parent
9218ede11d
commit
06299d1966
4 changed files with 7 additions and 4 deletions
|
|
@ -43,7 +43,7 @@ public class VisorService : IDisposable
|
|||
if (oldState == on)
|
||||
return false;
|
||||
|
||||
SetupVisorHook(human, human.GetArmor(EquipSlot.Head).Set.Id, on);
|
||||
SetupVisorDetour(human, human.GetArmor(EquipSlot.Head).Set.Id, on);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ public class VisorService : IDisposable
|
|||
Glamourer.Log.Excessive(
|
||||
$"[SetVisorState] Invoked from game on 0x{human:X} switching to {on} (original {originalOn}).");
|
||||
|
||||
SetupVisorHook(human, modelId, on);
|
||||
SetupVisorDetour((Model)human, modelId, on);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -70,7 +70,7 @@ public class VisorService : IDisposable
|
|||
/// So we wrap a manual change of that flag with the function call.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
private unsafe void SetupVisorHook(Model human, ushort modelId, bool on)
|
||||
private unsafe void SetupVisorDetour(Model human, ushort modelId, bool on)
|
||||
{
|
||||
human.AsCharacterBase->VisorToggled = on;
|
||||
_setupVisorHook.Original(human.Address, modelId, on);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue